commit bf667f282a7b98e7456d11e1cb46d9707ab8e774 Author: Ryan Libby Date: Wed Feb 24 15:56:16 2021 -0800 ofed: quiet gcc -Wint-in-bool-context The int in the argument to the ternary triggered -Wint-in-bool-context from gcc. Upstream linux has a larger and more entangled patch, 12f727721eee61b3d19dedb95cb893b2baa9fe41, which doesn't apply cleanly. When we eventually sync that, we can just drop this change. Reviewed by: hselasky, imp, kib MFC after: 3 days Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D28762 commit d8404b7ec36d4974e7ac586df1d74be4ef6b141e Author: Ryan Libby Date: Wed Feb 24 15:56:16 2021 -0800 ddb: just move cursor when the lexer backs up Get rid of db_look_char because it's not compatible with db_get_line(). This fixes the following issue: db> script lockinfo=show alllocks db> run lockinfo db:0:lockinfo> how alllocks No such command; use "help" to list available commands Reported by: markj Reviewed by: markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D28725 commit d85c9cef1380f4f135aee95ad8c1f4d3eca74c5b Author: Ryan Libby Date: Wed Feb 24 15:56:16 2021 -0800 ddb: reliably fail with ambiguous commands db_cmd_match had an even/odd bug, where if a third command was partially matched (or any odd number greater than one) the search result would be set back from CMD_AMBIGUOUS to CMD_FOUND, causing the last command in the list to be executed instead of failing the match. Reported by: mlaier Reviewed by: markj, mlaier, vangyzen Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D28659 commit 14b5a3c7d5c034c2a5a487b5e2d0de79c2801a65 Author: Max Laier Date: Wed Feb 24 15:56:16 2021 -0800 vm pqbatch: move unmanaged page assert under pagequeue lock This KASSERT is overzealous because of the following race condition: 1) A managed page which is currently in PQ_LAUNDRY is freed. vm_page_free_prep calls vm_page_dequeue_deferred() The page state is: PQ_LAUNDRY, PGA_DEQUEUE|PGA_ENQUEUED 2) The laundry worker comes around and pick up the page and calls vm_pageout_defer(m, PQ_LAUNDRY, true) to check if page is still in the queue. We do a vm_page_astate_load and get PQ_LAUNDRY, PGA_DEQUEUE|PGA_ENQUEUED as per above. 3) The laundry worker is pre-empted and another thread allocates our page from the free pool. For example vm_page_alloc_domain_after calls vm_page_dequeue() and sets VPO_UNMANAGED because we are allocating for an OBJT_UNMANAGED object. The page state is: PQ_NONE, 0 - VPO_UNMANAGED 4) The laundry worker resumes, and processes vm_pageout_defer based on the stale astate which leads to a call to vm_page_pqbatch_submit, which will trip on the KASSERT. Submitted by: mlaier Reviewed by: markj, rlibby Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D28563 commit 9a227a2fd642ec057a0ec70d67d5699d65553294 Author: Marcin Wojtas Date: Fri Jan 22 13:13:03 2021 +0100 Enable PIE by default on 64-bit architectures This patch adds Position Independent Executables (PIE) flags for building OS. It allows to enable the ASLR feature based only on the sysctl knobs, without need to rebuild the image. Tests showed that no problems with stability / performance degradation were seen when using PIEs with ASLR disabled. The change is limited only for 64-bit architectures. Use bsd.opts.mk instead of the src.opts.mk in order to satisfy all build dependencies related to MK_PIE. Reviewed by: emaste, imp Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D28328 commit 3aa023643e9db78f4da314ff9bfb1643533c004f Author: Marcin Wojtas Date: Tue Feb 23 13:42:26 2021 +0100 Disable PIE for powerpc bootloaders. Bootloaders for powerpc are not built as position independent code. Since bsd.prog.mk is used for building, when PIE is enabled, the PIE flags are added and that causes the build to fail. Adding MK_PIE=no stops bsd.prog.mk from adding PIE specific flags. Submitted by: Dawid Gorecki Reviewed by: emaste Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D28893 commit cd992885bcdfb3c2c6b761f5c3bf1c86949acdc3 Author: Marcin Wojtas Date: Fri Feb 12 16:41:49 2021 +0100 Disable PIE for MIPS ubldr When performing buildworld for MIPS with PIE enabled, the build fails with "position-independent code requires '-mabicalls'" message. -mno-abicalls and -fno-pic flags are explicitly set in MIPS ubldr makefile, so to work around this problem, set MK_PIE=no for MIPS ubldr. Submitted by: Dawid Gorecki Reviewed by: emaste Obtained from: Semihalf Sponsored by: Stormshield Differential Revision: https://reviews.freebsd.org/D28370 commit 6dd69f0064f1e54671cdb46ce5975a332fb761e8 Author: Marcin Wojtas Date: Wed Feb 24 23:56:45 2021 +0100 iflib: introduce isc_dma_width Some DMA controllers are unable to address the full host memory space and are instead limited to a subset of address range (e.g. 48-bit). Allow the driver to specify the maximum allowed DMA addressing width (in bits) for the NIC hardware, by introducing a new field in if_softc_ctx. If said field is omitted (set to 0), the lowaddr of DMA window bounds defaults to BUS_SPACE_MAXADDR. Submitted by: Artur Rojek Obtained from: Semihalf Sponsored by: Amazon, Inc. Differential Revision: https://reviews.freebsd.org/D28706 commit cc3fa1e29fda2cc761e793a61cef3bd2522b3468 Author: Alexander V. Chernikov Date: Wed Feb 24 16:42:48 2021 +0000 Fix crash with rtadv-originated multipath IPv6 routes. PR: 253800 Reported by: Frederic Denis MFC after: immediately commit e2494f7561c852951d8ac567314f5e12f19ee7af Author: Konstantin Belousov Date: Wed Feb 24 00:12:29 2021 +0200 atomic: add atomic_interrupt_fence() with the semantic following C11 signal_fence, that is, it establishes ordering between its place and any interrupt handler executing on the same CPU. Reviewed by: markj, mjg, rlibby Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28909 commit 43d4dfac96f7f8285a27989f315c075d28aadb12 Author: Brett Mastbergen Date: Mon Feb 22 10:28:28 2021 +0000 pwm_backlight: Add MODULE_DEPEND on backlight Make the pwm_backlight module depend on backlight, so it has access to the backlight interface symbols. Otherwise you'll get an error like: link_elf: symbol backlight_get_info_desc undefined Signed-off-by: Brett Mastbergen MFC after: 3 days PR: 253765 commit f7aebfbe5c0ab63dbb3d134d143ccff2c2b278bb Author: Nathan Whitehorn Date: Wed Feb 24 10:31:44 2021 -0500 Add GPT PREP-boot type to mkimg(1) from geom_gpt. This partition type can be used to boot some PowerKVM VMs. We don't support it well because of some limitations in SLOF, but it's worth at least have feature parity in geom and mkimg. commit b6999635b195e8c0dd5c08ac9ff268c92107cc66 Author: Mark Johnston Date: Wed Feb 24 10:08:53 2021 -0500 iflib: Avoid double counting in rxeof iflib_rxeof() was counting everything twice. This was introduced when pfil hooks were added to the iflib receive path. We want to count rx packets/bytes before the pfil hooks are executed, so remove the counter adjustments that are executed after. PR: 253583 Reviewed by: gallatin, erj MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28900 commit e70eb40271512dfbca7cecf823e4b445e3989c2e Author: Nathan Whitehorn Date: Wed Feb 24 08:18:07 2021 -0500 Mount the ESP on /boot/efi in VM images. This follows an earlier change (0b7472b3d8d2) for mounting the ESP from systems set up through the installer and should be MFC'ed with it. commit 6f30ac9995ff662a2fee5eda4cd87dd0f0e337ba Author: Konstantin Belousov Date: Sun Feb 21 12:11:54 2021 +0200 Call softdep_prealloc() before taking ffs_lock_ea(), if unlock is committing softdep_prealloc() must be called to ensure enough journal space is available, before ffs_extwrite(). Also it must be done before taking ffs_lock_ea(), because it calls ffs_syncvnode(), potentially dropping the vnode lock. Reviewed by: mckusick Tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation commit 5e198e7646a27412c0541719f7bf1bbc0bd89223 Author: Konstantin Belousov Date: Sun Feb 21 12:10:06 2021 +0200 ffs_close_ea: do not relock vnode under lock_ea ffs_lock_ea is after the vnode lock, so vnode must not be relocked under lock_ea. Move ffs_truncate() call in ffs_close_ea() after the lock_ea is dropped, and only truncate to length zero, since this is the only mode supported by ffs_truncate() for EAs. Previously code did truncation and then write. Zero the part of the ext area that is unused, if truncation is due but not done because ea area is not zero-length. Reviewed by: mckusick Tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation commit c6d68ca842a3f5b6814cdd5c87e406bad579b792 Author: Konstantin Belousov Date: Sat Feb 20 19:01:40 2021 +0200 ffs_vnops.c: style Use local var to shorten ap->a_vp expression. Reviewed by: mckusick Tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation commit 49831462794690155ce8dbe02679e6d9390f3d7d Author: Konstantin Belousov Date: Thu Feb 18 16:51:50 2021 +0200 ffs: do not call softdep_prealloc() from UFS_BALLOC() Do it in ffs_write(), where we can gracefuly handle relock and its consequences. In particular, recheck the v_data to see if the vnode reclamation ended, and return EBADF when we cannot proceed with the write. Reviewed by: mckusick Reported by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation commit cc9958bf22f1426faf4be8bf492ce69587a9008f Author: Konstantin Belousov Date: Fri Feb 19 14:37:12 2021 +0200 ffs_reallocblks: change the guard for softdep_prealloc() call to DOINGSUJ() instead of DOINGSOFTDEP(). The softdep_prealloc() function does nothing in SU case. Note that the call should be safe with regard to the vnode relock, because it is called with MNT_NOWAIT, which does not descend into fsync. Reviewed by: mckusick Tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation commit 6e822e99570fdf4c564be04840a054bccc070222 Author: Cy Schubert Date: Tue Feb 23 21:12:49 2021 -0800 rc: fix parse of $local_startup 77e1ccbee3ed6c837929e4e232fd07f95bfc8294 introduced parallel execution of rc. It separated groups with line feeds (\n) and elements within groups using spaces. This is a natural separation due to rcorder using spaces and lines to separate elements within groups with groups of services separated by line feeds. 77e1ccbee3ed6c837929e4e232fd07f95bfc8294 parses the output from rcorder by setting $IFS. However it failed to reset $IFS to default ' \t\n' prior to calling find_local_scripts_new(), causing find_local_scripts_new() to fail parsing $local_startup for site-specific local rc scripts, i.e. ${LOCALBASE}/etc/rc.d. This caused daemons from ports and packages such as postfix, dovecot, nut, and others in ${LOCALBASE} not to be started. PR: 249192 MFC after: 3 week X-MFC with: 77e1ccbee3ed6c837929e4e232fd07f95bfc8294 commit ec786886661ac8d6c41420c4460eba8461308e0b Author: Rajesh Kumar M A Date: Wed Feb 24 05:01:10 2021 +0000 Update manpage for AMD 10GbE driver Approved by: vmaffione, gallatin Differential Revision: https://reviews.freebsd.org/D28724 MFC after: 1 week commit 1af48800c20fadb07acca2ab930bb3bccd363edb Author: Nathan Whitehorn Date: Tue Feb 23 22:17:20 2021 -0500 Delete memstick images for PowerPC. These images only ever worked on Apple Powermacs, which are now a very old platform, and did so only for a very loose definition of "worked" (they booted on a small subset of supported machines). Moreover, all the machines they *did* boot on also would boot from a memstick made by dd'ing an CD image to a flash drive. Since a flash drive prepared in this way would also boot all the newer systems we support, the memstick images were strictly less functional than the CD images, even for booting from memory sticks. Reviewed by: jhibbits MFC after: 1 week commit 1d44514fcd68809cfd493a7352ace29ddad443d6 Author: Mark Johnston Date: Tue Feb 23 21:15:50 2021 -0500 rmlock: Add a required compiler membar to the rlock slow path The tracker flags need to be loaded only after the tracker is removed from its per-CPU queue. Otherwise, readers may fail to synchronize with pending writers attempting to propagate priority to active readers, and readers and writers deadlock on each other. This was observed in a stable/12-based armv7 kernel where the compiler had reordered the load of rmp_flags to before the stores updating the queue. Reviewed by: rlibby, scottl Discussed with: kib Sponsored by: Rubicon Communications, LLC ("Netgate") MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28821 commit 6ab923cbca8759503a08683a5978b9ebf5efd607 Author: Mark Johnston Date: Tue Feb 23 17:01:29 2021 -0500 pam_login_access: Fix negative entry matching logic PR: 252194 Approved by: so Security: CVE-2020-25580 Security: FreeBSD-SA-21:03.pam_login_access commit 6d67af5f8e66218ab0b3d927837fe00903c2feac Author: Allan Jude Date: Tue Feb 23 22:48:42 2021 +0000 Revert "ipmi_smbios: Deduplicate smbios entry point discovery logic" This depends on another commit that has not landed yet, and broke the build This reverts commit ba6e37e47f41484fc61cc034619267b82ddd056c. commit 4a5dfded17efb48fd04bcc8d69b70597b8cea808 Author: Allan Jude Date: Tue Feb 23 22:48:37 2021 +0000 Revert "ipmi_smbios: remove unused smbios_cksum function" This reverts commit d2589dc3d56ce063b28b54df11c950c3758d9578. commit 9c4a8d24f0ffd5243fa5c6fe27178f669f16d1f5 Author: Alexander V. Chernikov Date: Tue Feb 23 22:31:07 2021 +0000 Fix nd6 rib_action() handling. rib_action() guarantees valid rc filling IFF it returns without error. Check rib_action() return code instead of checking rc fields. PR: 253800 Reported by: Frederic Denis MFC after: immediately commit bbacb7ce72956a41c0daeefe875e5209d87c11ba Author: Vladimir Kondratyev Date: Wed Feb 24 01:20:36 2021 +0300 ig4: Add PCI IDs for Intel Gemini Lake I2C controller. Submitted by: Dmitry Luhtionov MFC after: 2 weeks commit 408edcca0746d15303e0b47bbf31a6d4aa721363 Author: Daniel Ebdrup Jensen Date: Tue Feb 23 22:25:44 2021 +0100 rc.conf(5): Add note about parallel startup variable The commit below added parallel service startup, and it needs to be documented, so people know about it. PR: 249192 MFC with: 77e1ccbee3ed Reviewed by: yuripv Differential Revision: https://reviews.freebsd.org/D28898 commit d2589dc3d56ce063b28b54df11c950c3758d9578 Author: Allan Jude Date: Tue Feb 23 21:24:12 2021 +0000 ipmi_smbios: remove unused smbios_cksum function Sponsored By: Ampere Computing LLC Submitted By: Klara Inc. Differential Revision: https://reviews.freebsd.org/D28751 commit 0b7472b3d8d2f1e90fade5236b44fd98d8e396c2 Author: Nathan Whitehorn Date: Tue Feb 23 16:16:52 2021 -0500 Mount the EFI system partition (ESP) on newly-installed systems. Per hier(7), the ESP will be mounted at /boot/efi. On UFS systems, any existing ESP will be reused and mounted there; otherwise, a new one will be made. On ZFS systems, space for an ESP is allocated on all disks in the root pool, but only the partition actually used to boot is set up and mounted. This makes future upgrades of the EFI loader easier (upgrade scripts can just change /boot/efi) and also greatly simplifies the parts of the installer involved in initialization of the ESP. It also makes the installer's behavior correspond to the documentation in hier(7). Reviewed by: imp, tsoome MFC after: 1 week Relnotes: yes Differential Revision: https://reviews.freebsd.org/D28897 commit ba6e37e47f41484fc61cc034619267b82ddd056c Author: Allan Jude Date: Tue Feb 23 21:17:37 2021 +0000 ipmi_smbios: Deduplicate smbios entry point discovery logic Sponsored by: Ampere Computing LLC Submitted by: Klara Inc. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D28743 commit d0673fe160b04f8162f380926d455dfb966f08fb Author: Allan Jude Date: Tue Feb 23 21:14:18 2021 +0000 smbios: Move smbios driver out from x86 machdep code Add it to the x86 GENERIC and MINIMAL kernels Sponsored by: Ampere Computing LLC Submitted by: Klara Inc. Reviewed by: rpokala Differential Revision: https://reviews.freebsd.org/D28738 commit cf97d2a1dab8f2cddc4466fe64d37818339c73be Author: Dimitry Andric Date: Tue Feb 23 21:03:32 2021 +0100 Build lib/msun tests with compiler builtins disabled This forces the compiler to emit calls to libm functions, instead of possibly substituting pre-calculated results at compile time, which should help to actually test those functions. Reviewed by: emaste, arichardson, ngie Differential Revision: https://reviews.freebsd.org/D28577 MFC after: 3 days commit 11ba8488b8636a91668c0ee13d35d9e126dfba53 Author: Allan Jude Date: Tue Feb 23 20:06:16 2021 +0000 iicsmb: Request the bus recursively in bread() ipmi_ssif will `smbus_request_bus()` to do multiple smbus requests (which requests the iicbus), and then here in `bread()` we also need to request the bus because `bread()` takes multiple transactions. This causes deadlock as it's waiting for the bus it already has without `IIC_RECURSIVE`. Sponsored by: Ampere Computing LLC Submitted by: Klara Inc. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D28742 commit 6b7580f7b1b66134286813b971ab575862b95426 Author: Warner Losh Date: Tue Feb 23 12:33:26 2021 -0700 camcontrol: change hueristic for I/O-less devtype Some SATA drives have 'config' set to 0 in the identify block. Rather than rely on it, use the strings windows uses to display the drive since they are supposed to be space padded and will always be non-zero. commit ef1a1fc7e828d640790fe849487221ef370a410a Author: Daniel Ebdrup Jensen Date: Tue Feb 23 19:10:21 2021 +0100 release(7) Fix mistake noted in review I missed this when doing the final pass. Fixes: f695e960 release(7): Remove stray references to DOC* variables commit 3ae8d83d04a7a6ec11b64c89ee60c180b0bde30e Author: Konstantin Belousov Date: Fri Feb 19 17:20:29 2021 +0200 Remove __NO_TLS. All supported platforms support thread-local vars and __thread. Reviewed by: emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28796 commit f695e960672ddc45744aca085c1e22c80928f447 Author: Daniel Ebdrup Jensen Date: Tue Feb 23 19:06:36 2021 +0100 release(7): Remove stray references to DOC* variables We now live in the world of git, and release(7) should reflect that. As of the commit referenced below, release images also no longer include (stale) documentation, as the documentation has moved to AsciiDoctor. This means that a few environment variables no longer make sense, so remove them from their sections and mention them in the compatibility section instead. While here, also pet mandoc. PR: 253615 MFC after: 3 days MFC with: f61e92ca5a23 release: permanently remove the 'reldoc' target and associates Reviewed by: gjb, lwhsu, yuripv Differential Revision: https://reviews.freebsd.org/D28881 commit fa32350347b4e351a144b5423f0fb2ca9d67f4ca Author: Alex Richardson Date: Tue Feb 23 17:47:07 2021 +0000 close_range: add audit support This fixes the closefrom test in sys/audit. Includes cherry-picks of the following commits from openbsm: https://github.com/openbsm/openbsm/commit/4dfc628aafe589d68848f7033f3d3488c4d979e0 https://github.com/openbsm/openbsm/commit/99ff6fe32aebc5a4b8d40d60062b8574697df557 https://github.com/openbsm/openbsm/commit/da48a0399e95448693d3fa2be48454ca564c1be8 Reviewed By: kevans Differential Revision: https://reviews.freebsd.org/D28388 commit 3775ddcf5a12c8e23970e94b7b165bf23c92aeba Author: Alex Richardson Date: Tue Feb 23 17:02:31 2021 +0000 tests/sys/netgraph: Tell kyua that perl is required Otherwise these tests fail with incomprehensible error messages. Reviewed By: kp Differential Revision: https://reviews.freebsd.org/D28894 commit 75e6f664c469927ca73ecd7b16a8058bc292a451 Author: Daniel Ebdrup Jensen Date: Tue Feb 23 16:23:09 2021 +0100 find(1): Mark -not as an extensions to POSIX While here, change mdoc macro from Ic to Fl. PR: 253499 Reported by: Michael Siegel commit 7d4c444374d53e54ce197138df64bf40c1fb05a3 Author: Alexander Motin Date: Tue Feb 23 10:58:56 2021 -0500 Bump CTL block backend threads from 14 to 32 per LUN. This makes random read benchmarks look better on a wide ZFS pools. I am not sure where the original value goes from, but it is there for too long now. MFC after: 1 week commit 0eaa97f0e8629bcf678ff4de2678e4cba00f1c91 Author: Roger Pau Monné Date: Tue Feb 23 15:56:27 2021 +0100 stand/multiboot2: fix header length check Check whether we have reached the end of the buffer using search_size instead of MULTIBOOT_SEARCH, which is the maximum defined by the specification, but the file can be shorter than that. This prevents printing a harmless error message when loading a file that is smaller than MULTIBOOT_SEARCH. Sponsored by: Citrix Systems R&D MFC after: 3 days Fixes: adda2797eb2a ('stand/multiboot2: add support for booting a Xen dom0 in UEFI mode') commit ab379c15af6fd7c2b94f0e91769fe7e1a4102e25 Author: Roger Pau Monné Date: Tue Feb 23 15:51:58 2021 +0100 stand/multiboot2: fix error message format Add a missing space in one error message. Sponsored by: Citrix Systems R&D MFC after: 3 days Fixes: adda2797eb2a ('stand/multiboot2: add support for booting a Xen dom0 in UEFI mode') commit 26492ba2716f8b839f743bb663ce47405990fdf0 Author: Kristof Provost Date: Sat Feb 20 10:13:33 2021 +0100 bridge tests: Test STP on top of VLAN devices This is basically the same test as the existing STP test, but now on top of VLAN interfaces instead of directly using the epair devices. MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28861 commit c139b3c19b52abe3b5ba23a8175e58e70c7a528d Author: Kristof Provost Date: Mon Feb 22 08:19:43 2021 +0100 arp/nd: Cope with late calls to iflladdr_event When tearing down vnet jails we can move an if_bridge out (as part of the normal vnet_if_return()). This can, when it's clearing out its list of member interfaces, change its link layer address. That sends an iflladdr_event, but at that point we've already freed the AF_INET/AF_INET6 if_afdata pointers. In other words: when the iflladdr_event callbacks fire we can't assume that ifp->if_afdata[AF_INET] will be set. Reviewed by: donner@, melifaro@ MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28860 commit 38c0951386d82f4c51cf4e245253cdef18d2254a Author: Kristof Provost Date: Sun Feb 21 21:20:32 2021 +0100 bridge: Remove members when assigned to a new vnet When the bridge is moved to a different vnet we must remove all of its member interfaces (and span interfaces), because we don't know if those will be moved along with it. We don't want to hold references to interfaces not in our vnet. Reviewed by: donner@ MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28859 commit 89fa9c34d76bbf85cd7cda60c1868f5e3dba4ec7 Author: Kristof Provost Date: Sun Feb 21 21:18:46 2021 +0100 bridge/stp: Ensure we enter NET_EPOCH whenever we can send traffic Reviewed by: donner@ MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28858 commit 711ed156b94562c3dcb2ee9c1b3f240f960a75d2 Author: Kristof Provost Date: Sat Feb 20 10:11:30 2021 +0100 bridge: Support STP on VLAN devices VLAN devices have type IFT_L2VLAN, so the STP code mistakenly believed they couldn't be used for STP. That's not the case, so add the ITF_L2VLAN to the check. Reviewed by: donner@ MFC after: 1 week Sponsored by: Orange Business Services Differential Revision: https://reviews.freebsd.org/D28857 commit d27999e51396b301d83bb7d6cdd51f6d6f4fff2d Author: Chris Rees Date: Sun Feb 21 18:56:56 2021 +0000 Create dhclient pid directory if it doesn't exist - Upgrading from older FreeBSD versions can result in errors - /var/run can be a tmpfs, and this should be handled correctly Approved by: markj Differential Revision: https://reviews.freebsd.org/D28843 MFC after: 2 weeks commit 77e1ccbee3ed6c837929e4e232fd07f95bfc8294 Author: Rick Parrish Date: Sun Feb 7 07:15:21 2021 +0100 rc: implement parallel boot take advantage of the rcorder -p argument to implement parallel booting in rc. According to the author non scientific tests: on a Core 2 Duo with spinning disk: | Services enabled | before | after | saving | | 0 | 8s | 8s | 0 | | 1 | 13s | 13s | 0 | | 2 | 17s | 13s | 5 | | 3 | 23s | 13s | 10 | | 4 | 28s | 13s | 15 | | 5 | 33s | 13s | 20 | PR: 249192 MFC after: 3 weeks commit f3f7b0dc065ce30f29b221788c58079d78931a77 Author: Alex Richardson Date: Tue Feb 23 09:38:57 2021 +0000 lib/msun/ctrig_test: Print the mismatched values on failure This test fails on aarch64 but debugging it is difficult without the results being printed. Now the failing AArch64 test prints: root@freebsd-aarch64:/nfsroot/usr/tests/lib/msun # kyua debug ctrig_test:test_nan_inputs *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: (ctan)(_d) (0 + -1 I) != expected (-0 + -1 I) *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: ctan fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0 *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: (ctan)(_d) (0 + 1 I) != expected (-0 + 1 I) *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: ctan fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0 *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: (ctanf)(_d) (0 + -1 I) != expected (-0 + -1 I) *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: ctanf fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0 *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: (ctanf)(_d) (0 + 1 I) != expected (-0 + 1 I) *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:211: ctanf fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0 *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: (ctanh)(_d) (1 + 0 I) != expected (1 + -0 I) *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: ctanh fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0 *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: (ctanhf)(_d) (1 + 0 I) != expected (1 + -0 I) *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: ctanhf fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0 *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: (ctanh)(_d) (-1 + 0 I) != expected (-1 + -0 I) *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: ctanh fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0 *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: (ctanhf)(_d) (-1 + 0 I) != expected (-1 + -0 I) *** Check failed: /local/scratch/alr48/cheri/freebsd/lib/msun/tests/ctrig_test.c:217: ctanhf fetestexcept((0x00000002 | 0x00000010 | 0x00000001 | 0x00000004 | 0x00000008)) (0x10) != 0 ctrig_test:test_nan_inputs -> failed: 16 checks failed; see output for more details Reviewed By: ngie Differential Revision: https://reviews.freebsd.org/D28788 commit a7ac518bff64d48cf262c60c4dc57eef34e74a07 Author: Eric Joyner Date: Mon Feb 22 17:43:54 2021 -0800 ice_ddp: Update package file to 1.3.19.0 This package is intended to be used with ice(4) version 0.28.1-k. That update will happen in a forthcoming commit. Signed-off-by: Eric Joyner Sponsored by: Intel Corporation commit 0a2a96f35a4c2dab3486438680fa289e12971e4b Author: Jamie Gritton Date: Mon Feb 22 17:04:06 2021 -0800 jail: Don't allow jails under dying parents If a jail is created with jail_set(...JAIL_DYING), and it has a parent currently in a dying state, that will bring the parent jail back to life. Restrict that to require that the parent itself be explicitly brought back first, and not implicitly created along with the new child jail. Differential Revision: https://reviews.freebsd.org/D28515 commit 7f06b217c53c3f5e4ac81eb11125adfb71359ac6 Author: Mateusz Guzik Date: Sun Feb 21 21:20:04 2021 +0000 amd64: import asm strlen into libc Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D28845 commit 701d6b50ae7b0b2b50fbd191c2dbd646ef3b4a67 Author: Jamie Gritton Date: Mon Feb 22 15:51:10 2021 -0800 jail: Fix a LOR introduced in 1158508a8086 commit 596417283722ee62ed17aed1c875ad90c01cbb0e Author: Alexander V. Chernikov Date: Mon Feb 22 21:42:27 2021 +0000 Simplify ifa/ifp refcounting in the routing stack. The routing stack control depends on quite a tree of functions to determine the proper attributes of a route such as a source address (ifa) or transmit ifp of a route. When actually inserting a route, the stack needs to ensure that ifa and ifp points to the entities that are still valid. Validity means slightly more than just pointer validity - stack need guarantee that the provided objects are not scheduled for deletion. Currently, callers either ignore it (most ifp parts, historically) or try to use refcounting (ifa parts). Even in case of ifa refcounting it's not always implemented in fully-safe manner. For example, some codepaths inside rt_getifa_fib() are referencing ifa while not holding any locks, resulting in possibility of referencing scheduled-for-deletion ifa. Instead of trying to fix all of the callers by enforcing proper refcounting, switch to a different model. As the rib_action() already requires epoch, do not require any stability guarantees other than the epoch-provided one. Use newly-added conditional versions of the refcounting functions (ifa_try_ref(), if_try_ref()) and fail if any of these fails. Reviewed by: donner MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28837 commit 7563019bc69301a382abefbac3b0fea1d876410e Author: Alexander V. Chernikov Date: Mon Feb 22 21:37:55 2021 +0000 Add if_try_ref() to simplify refcount handling inside epoch. When we have an ifp pointer and the code is running inside epoch, epoch guarantees the pointer will not be freed. However, the following case can still happen: * in thread 1 we drop to refcount=0 for ifp and schedule its deletion. * in thread 2 we use this ifp and reference it * destroy callout kicks in * unhappy user reports a bug This can happen with the current implementation of ifnet_byindex_ref(), as we're not holding any locks preventing ifnet deletion by a parallel thread. To address it, add if_try_ref(), allowing to return failure when referencing ifp with refcount=0. Additionally, enforce existing if_ref() is with KASSERT to provide a cleaner error in such scenarios. Finally, fix ifnet_byindex_ref() by using if_try_ref() and returning NULL if the latter fails. MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28836 commit 537f92cd351090c09b178a1749cd1d0326f74dc7 Author: Mark Johnston Date: Mon Feb 22 18:21:49 2021 -0500 uma: Update the comment above startup_alloc() to reflect reality The scheme used for early slab allocations changed in commit a81c400e75. Reported by: alc Reviewed by: alc MFC after: 1 week commit d510bf133d045d6c83742aeda6949bec150f6cbf Author: Alexander Motin Date: Mon Feb 22 17:21:05 2021 -0500 cxgb(4): Rework my commit 9dc7c250. The previous implementation was reported to try to coalesce packets in situations when it should not, that resulted in assertion later. This implementation better checks the first packet of the chain for the coallescing elligibility. MFC after: 3 days commit 963cf6cb0fd7e8708c455ecf567fbc34fe2a7156 Author: Jessica Clarke Date: Mon Feb 22 22:27:00 2021 +0000 uefi: Add riscv to historical details commit 61c50cbc096d28e44cb8b627e524ae58158c423a Author: Toomas Soome Date: Sun Feb 21 12:32:18 2021 +0200 loader: autoload_font will hung loader when there is no local console If we start with console set to comconsole, the local console (vidconsole, efi) is never initialized and attempt to use the data can render the loader hung. Reported by: Kamigishi Rei MFC after: 3 days commit f11e9f325aee3459fee94f3a660a8e6c1a25c2ac Author: Warner Losh Date: Mon Feb 22 14:39:04 2021 -0700 Restore missing word "in" got dropped when I shuffled things around. Noticed by: rpokala@ MFC After: 3 days commit 8c09ecb2e25155b4f1490a177826608d52b1bd1b Author: Warner Losh Date: Mon Feb 22 14:20:00 2021 -0700 uefi: add historical details Add details about when armv6 and armv7 support was added. commit 23e875fd97fb9f17b3f5dc2b26082f25e1a86b6f Author: Mark Johnston Date: Mon Feb 22 15:50:09 2021 -0500 vm_kern: Avoid sign extension in the KVA_QUANTUM definition Otherwise, on a powerpc64 NUMA system with hashed page tables, the first-level superpage reservation size is large enough that the value of the kernel KVA arena import quantum, KVA_NUMA_IMPORT_QUANTUM, is negative and gets sign-extended when passed to vmem_set_import(). This results in a boot-time hang on such platforms. Reported by: bdragon MFC after: 3 days commit 5ce2d4a1c2922821b9940473213c0d75469755fc Author: Robert Wing Date: Thu Feb 18 17:48:40 2021 -0900 bhyve/snapshot: drop mkdir when creating the unix domain socket Add /var/run/bhyve/ to BSD.var.dist so we don't have to call mkdir when creating the unix domain socket for a given bhyve vm. The path to the unix domain socket for a bhyve vm will now be /var/run/bhyve/vmname instead of /var/run/bhyve/checkpoint/vmname Move BHYVE_RUN_DIR from snapshot.c to snapshot.h so it can be shared to bhyvectl(8). Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D28783 commit 811e27fa3c445664e36071a7d08228fc7fb85676 Author: Jamie Gritton Date: Mon Feb 22 12:27:44 2021 -0800 jail: Add PD_KILL to remove a prison in prison_deref(). Add the PD_KILL flag that instructs prison_deref() to take steps to actively kill a prison and its descendents, namely marking it PRISON_STATE_DYING, clearing its PR_PERSIST flag, and killing any attached processes. This replaces a similar loop in sys_jail_remove(), bringing the operation under the same single hold on allprison_lock that it already has. It is also used to clean up failed jail (re-)creations in kern_jail_set(), which didn't generally take all the proper steps. Differential Revision: https://reviews.freebsd.org/D28473 commit ab77cc9e7bf6d0c2d862dfd514539b81ae248dfd Author: Warner Losh Date: Mon Feb 22 13:19:21 2021 -0700 Remove incorrect statement about EFI environment variables being unsupported. Our uefi support has included environment variable support for several years now. Remove the bogus blanket statement saying we don't support them. MFC After: 3 days commit d149877758f162f0c777e7760164bf2c1f7a1bc1 Author: Dimitry Andric Date: Mon Feb 22 21:01:09 2021 +0100 Fix possibly unitialized variables in __cxa_demangle_gnu3() After 0ee0dbfb0d26cf4bc37f24f12e76c7f532b0f368 where I imported a more recent libcxxrt snapshot, the variables 'rtn' and 'has_ret' could in some cases be used while still uninitialized. Most obviously this would lead to a jemalloc complaint about a bad free(), aborting the program. Fix this by initializing a bunch variables in their declarations. This change has also been sent upstream, with some additional changes to be used in their testing framework. PR: 253226 MFC after: 3 days commit a805ffbcbce85872e71d825fd405a4a30e2ab4bc Author: Cy Schubert Date: Tue Feb 16 07:44:07 2021 -0800 ipfilter: Make LARGE_NAT a tunable. LARGE_NAT is a C macro that increases NAT_SIZE from 127 to 2047, RDR_SIZE from 127 to 2047, HOSTMAP_SIZE from 2047 to 8191, NAT_TABLE_MAX from 30000 to 180000, and NAT_TABLE_SZ from 2047 to 16383. These values can be altered at runtime using the ipf -T command however some adminstrators of large firewalls rebuild the kernel to enable LARGE_NAT at boot. This revision adds the tunable net.inet.ipf.large_nat which allows an administrator to set this option at boot instead of build time. Setting the LARGE_NAT macro to 1 is unaffected allowing build-time users to continue using the old way. commit e2ad10e84792e8dcfb0e03a9b5cb19cd3d93ddf8 Author: Cy Schubert Date: Fri Feb 12 07:17:32 2021 -0800 Remove the redundant ipfilter IPv6 rc rules load. As of ipfilter 5.1.2 the IPv4 and IPv6 rules tables have been merged. The ipf(8) -6 option has been a NOP since then. Currently the additional ipf -6 load statement in rc.d/ipfilter simply added the second ipfilter rules file to the table already populated by the previous ipf command. Plenty of time has passed since ipfilter 5.1.2 was imported. It is time to remove the option from rc.conf and the rc script. Differential Revision: https://reviews.freebsd.org/D28615 commit 519496a5985549d2935cf296a709b1e726b1b5e5 Author: Ed Maste Date: Mon Feb 22 14:03:28 2021 -0500 openssh: document two changes that are now upstream These patches can be removed once we update to 8.5p1 or later. commit ba2cfa80e1f2a7e8ffd383e615aa304afa349ed7 Author: Alex Richardson Date: Mon Feb 22 17:49:05 2021 +0000 Fix makefs bootstrap after d485c77f203fb0f4cdc08dea5ff81631b51d8809 The makefs msdosfs code includes fs/msdosfs/denode.h which directly uses struct buf from rather than the makefs struct m_buf. To work around this problem provide a local denode.h that includes ffs/buf.h and defines buf as an alias for m_buf. Reviewed By: kib, emaste Differential Revision: https://reviews.freebsd.org/D28835 commit 6895f89fe54e0858aea70d2bd2a9651f45d7998e Author: Alexander Motin Date: Mon Feb 22 12:23:35 2021 -0500 Coalesce socket reads in software iSCSI. Instead of 2-4 socket reads per PDU this can do as low as one read per megabyte, dramatically reducing TCP overhead and lock contention. With this on iSCSI target I can write more than 4GB/s through a single connection. MFC after: 1 month commit c1b554c868195ed10ac1eb25fa9ca4a5baae4638 Author: Alex Richardson Date: Mon Feb 22 17:26:21 2021 +0000 if_vtnet: Fix pointer-sign and used parameter warnings Reviewed By: grehan Differential Revision: https://reviews.freebsd.org/D28726 commit 1ec3feb64826d2a43d41e74684690985bf20e71c Author: Alex Richardson Date: Mon Feb 22 17:19:06 2021 +0000 Update libm tests from NetBSD I did this without a full vendor update since that would cause too many conflicts. Since these files now almost match the NetBSD sources the next git subtree merge should work just fine. Reviewed By: lwhsu Differential Revision: https://reviews.freebsd.org/D28797 commit 9febbc4541903bb8e6b0f1c84988c98b2f7c96ef Author: Hans Petter Selasky Date: Mon Feb 22 11:58:46 2021 +0100 Fix for natd(8) sending wrong sequence number after TCP retransmission, terminating a TCP connection. If a TCP packet must be retransmitted and the data length has changed in the retransmitted packet, due to the internal workings of TCP, typically when ACK packets are lost, then there is a 30% chance that the logic in GetDeltaSeqOut() will find the correct length, which is the last length received. This can be explained as follows: If a "227 Entering Passive Mode" packet must be retransmittet and the length changes from 51 to 50 bytes, for example, then we have three cases for the list scan in GetDeltaSeqOut(), depending on how many prior packets were received modulus N_LINK_TCP_DATA=3: case 1: index 0: original packet 51 index 1: retransmitted packet 50 index 2: not relevant case 2: index 0: not relevant index 1: original packet 51 index 2: retransmitted packet 50 case 3: index 0: retransmitted packet 50 index 1: not relevant index 2: original packet 51 This patch simply changes the searching order for TCP packets, always starting at the last received packet instead of any received packet, in GetDeltaAckIn() and GetDeltaSeqOut(). Else no functional changes. Discussed with: rscheff@ Submitted by: Andreas Longwitz PR: 230755 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking commit 808d4aad1022a2a33d222663b0c9badde30b9d45 Author: Roger Pau Monné Date: Wed Jan 20 19:40:51 2021 +0100 xen-blkback: fix leak of grant maps on ring setup failure Multi page rings are mapped using a single hypercall that gets passed an array of grants to map. One of the grants in the array failing to map would lead to the failure of the whole ring setup operation, but there was no cleanup of the rest of the grant maps in the array that could have likely been created as a result of the hypercall. Add proper cleanup on the failure path during ring setup to unmap any grants that could have been created. This is part of XSA-361. Sponsored by: Citrix Systems R&D commit aa8ae5fe17eb380b0f30f1641f17a0b3d83a68c3 Author: Ed Maste Date: Sat Feb 20 13:49:31 2021 -0500 git hooks: add "Fixes" trailer to commit message template A number of projects use "Fixes: " to identify a commit that is fixed by a given change. Adopt that convention. Differential Revision: https://reviews.freebsd.org/D28693 commit 608c44f96e88f28f9607374a6c9327d13d3d3d0e Author: Mark Johnston Date: Mon Feb 22 10:03:37 2021 -0500 m_uiotombuf_nomap(): Stop clearing PG_ZERO in newly allocated pages The caller should not be passing M_ZERO in the first place, so PG_ZERO will not be preserved by the page allocator and clearing it accomplishes nothing. Reviewed by: gallatin, jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28808 commit a0ba293c2fa0c45532520f9a288f7422902c1ccc Author: Stefan Eßer Date: Mon Feb 22 15:06:48 2021 +0100 Add missing entry for zfs_racct.c commit ba27dd8be821792e15bdabfac69fd6cab0cf9dd3 Merge: c02a28754bc 0626917d078 Author: Martin Matuska Date: Mon Feb 22 12:35:56 2021 +0100 zfs: merge OpenZFS master-9312e0fd1 Notable upstream changes: 778869fa1 Fix reporting of mount progress e7adccf7f Disable use of hardware crypto offload drivers on FreeBSD 03e02e5b5 Fix checksum errors not being counted on repeated repair 64e0fe14f Restore FreeBSD resource usage accounting 11f2e9a49 Fix panic if scrubbing after removing a slog device MFC after: 2 weeks commit c02a28754bc229c05e8baf9b6632cbd59bc73e48 Author: Alexander Motin Date: Sun Feb 21 17:21:14 2021 -0500 Fix build after 2c7dc6bae9fd. MFC after: 1 month commit 2c7dc6bae9fd5c2fa0a65768df8e4e99c2f159f1 Author: Alexander Motin Date: Sun Feb 21 16:45:14 2021 -0500 Refactor CTL datamove KPI. - Make frontends call unified CTL core method ctl_datamove_done() to report move completion. It allows to reduce code duplication in differerent backends by accounting DMA time in common code. - Add to ctl_datamove_done() and be_move_done() callback samethr argument, reporting whether the callback is called in the same context as ctl_datamove(). It allows for some cases like iSCSI write with immediate data or camsim frontend write save one context switch, since we know that the context is sleepable. - Remove data_move_done() methods from struct ctl_backend_driver, unused since forever. MFC after: 1 month commit 1158508a8086a1a93492c1a2e22b61cd7fee4ec7 Author: Jamie Gritton Date: Sun Feb 21 13:24:47 2021 -0800 jail: Add pr_state to struct prison Rather that using references (pr_ref and pr_uref) to deduce the state of a prison, keep track of its state explicitly. A prison is either "invalid" (pr_ref == 0), "alive" (pr_uref > 0) or "dying" (pr_uref == 0). State transitions are generally tied to the reference counts, but with some flexibility: a new prison is "invalid" even though it now starts with a reference, and jail_remove(2) sets the state to "dying" before the user reference count drops to zero (which was prviously accomplished via the PR_REMOVE flag). pr_state is protected by both the prison mutex and allprison_lock, so it has the same availablity guarantees as the reference counts do. Differential Revision: https://reviews.freebsd.org/D27876 commit 2443068d486020ed9a4250e0d3b28168c40f741a Author: Mateusz Guzik Date: Sun Feb 21 19:48:49 2021 +0000 vfs: shrink struct vnode to 448 bytes on LP64 ... by moving v_hash into a 4 byte hole. Combined with several previous size reductions this makes the size small enough to fit 9 vnodes per page as opposed to 8. Add a compilation time assert so that this is not unknowingly worsened. Note the structure still remains bigger than it should be. commit ee9b37ae5c115c41835119bb5c9d2e14c83abd65 Author: Mateusz Guzik Date: Sun Feb 21 19:57:21 2021 +0000 jail: fix build after the previous commit Noted by: Michael Butler commit 0626917d07863899cfee3820aa57c6b7ed4304f4 Author: Martin Matuska Date: Sun Feb 21 21:22:07 2021 +0100 Update vendor/openzfs to master-9312e0fd1 Notable changes: - fix reporting of mount progress (778869fa1) - disable use of hardware crypto offload drivers on FreeBSD (e7adccf7f) - fix checksum errors not being counted on repeated repair (03e02e5b5) - restore FreeBSD resource usage accounting (64e0fe14f) - fix panic if scrubbing after removing a slog device (11f2e9a49) commit f7496dcab0360a74bfb00cd6118f66323fffda61 Author: Jamie Gritton Date: Sun Feb 21 10:55:44 2021 -0800 jail: Change the locking around pr_ref and pr_uref Require both the prison mutex and allprison_lock when pr_ref or pr_uref go to/from zero. Adding a non-first or removing a non-last reference remain lock-free. This means that a shared hold on allprison_lock is sufficient for prison_isalive() to be useful, which removes a number of cases of lock/check/unlock on the prison mutex. Expand the locking in kern_jail_set() to keep allprison_lock held exclusive until the new prison is valid, thus making invalid prisons invisible to any thread holding allprison_lock (except of course the one creating or destroying the prison). This renders prison_isvalid() nearly redundant, now used only in asserts. Differential Revision: https://reviews.freebsd.org/D28419 Differential Revision: https://reviews.freebsd.org/D28458 commit b963ce4588b33f733aef3f7a7f3fbe5018a89728 Author: Michael Tuexen Date: Sun Feb 21 17:13:06 2021 +0100 sctp: improve computation of an alternate net Espeially handle the case where the net passed in is about to be deleted and therefore not in the list of nets anymore. MFC after: 3 days Reported by: syzbot+9756917a7c8381adf5e8@syzkaller.appspotmail.com commit 5ac839029d01c0f48e1b1ff1a599cb47cf5e98ee Author: Michael Tuexen Date: Sun Feb 21 13:03:57 2021 +0100 sctp: clear a pointer to a net which will be removed MFC after: 3 days commit 8b7239681e27ab75175c45c48e6ad1685571b1f2 Author: Konstantin Belousov Date: Wed Feb 17 14:35:56 2021 +0200 ext2fs: clear write cluster tracking on truncation Reviewed by: fsu, mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28679 commit 2bfd8992c7c7301166c74931ad63d4755bb4a6c7 Author: Konstantin Belousov Date: Mon Feb 15 06:35:59 2021 +0200 vnode: move write cluster support data to inodes. The data is only needed by filesystems that 1. use buffer cache 2. utilize clustering write support. Requested by: mjg Reviewed by: asomers (previous version), fsu (ext2 parts), mckusick Tested by: pho Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28679 commit d485c77f203fb0f4cdc08dea5ff81631b51d8809 Author: Konstantin Belousov Date: Thu Feb 18 15:43:58 2021 +0200 Remove #define _KERNEL hacks from libprocstat Make sys/buf.h, sys/pipe.h, sys/fs/devfs/devfs*.h headers usable in userspace, assuming that the consumer has an idea what it is for. Unhide more material from sys/mount.h and sys/ufs/ufs/inode.h, sys/ufs/ufs/ufsmount.h for consumption of userspace tools, with the same caveat. Remove unacceptable hack from usr.sbin/makefs which relied on sys/buf.h being unusable in userspace, where it override struct buf with its own definition. Instead, provide struct m_buf and struct m_vnode and adapt code to use local variants. Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D28679 commit 750ea20d3fb143a95ccf3ff84cfbe86cce9b9cac Author: Konstantin Belousov Date: Thu Feb 18 11:12:26 2021 +0200 Delete dead CLUSTERDEBUG config option. Reviewed by: mckusick Tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28679 commit e6bb49f12ca7a2dc103d69d4c70e1504195f70a6 Author: Baptiste Daroussin Date: Sun Feb 21 06:09:03 2021 +0100 pci_vendors: update to 2021.02.20 commit c9cb66f04d33b116d1c6f0fbd755e49772506932 Author: Baptiste Daroussin Date: Sun Feb 14 06:57:37 2021 +0100 termcap: add an entry for the foot terminal MFC after: 3 days commit 81174cd8e24aa2bb27f6a8b41032abf59add479f Author: Mateusz Guzik Date: Mon Feb 15 23:08:20 2021 +0100 vfs: employ vfs_ref_from_vp in statfs and fstatfs Avoids locking and unlocking the vnode. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D28695 commit a15f787adb4429b83fa911dcb60f69121aaee1ba Author: Mateusz Guzik Date: Mon Feb 15 23:08:40 2021 +0100 vfs: add vfs_ref_from_vp This generalizes what vop_stdgetwritemount used to be doing. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D28695 commit 5fa12fe0cd203efcbb2ac21e7c3e3fb9b2f801ae Author: Mateusz Guzik Date: Sun Feb 21 00:42:26 2021 +0000 amd64: implement strlen in assembly, take 2 Tested with glibc test suite. The C variant in libkern performs excessive branching to find the zero byte instead of using the bsfq instruction. The same code patched to use it is still slower than the routine implemented here as the compiler keeps neglecting to perform certain optimizations (like using leaq). On top of that the routine can be used as a starting point for copyinstr which operates on words intead of bytes. The previous attempt had an instance of swapped operands to andq when dealing with fully aligned case, which had a side effect of breaking the code for certain corner cases. Noted by jrtc27. Sample results: $(perl -e "print 'A' x 3"): stock: 211198039 patched:338626619 asm: 465609618 $(perl -e "print 'A' x 100"): stock: 83151997 patched: 98285919 asm: 120719888 Reviewed by: jhb, kib Differential Revision: https://reviews.freebsd.org/D28779 commit 6e1d1bfcac77603541706807803a198c6d954d7c Author: Jamie Gritton Date: Sat Feb 20 14:38:58 2021 -0800 jail: Improve locking when removing prisons Change the flow of prison_deref() so it doesn't let go of allprison_lock until it's completely done using it (except for a possible drop as part of an upgrade on its first try). Differential Revision: https://reviews.freebsd.org/D28458 MFC after: 3 days commit a8e431e1537d056a3f9e466eaceec28c399c220b Author: Richard Scheffenegger Date: Sat Feb 20 20:10:00 2021 +0100 PRR: use accurate rfc6675_pipe when enabled Reviewed By: #transport, tuexen MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D28816 commit f17f94cd1b99c61faa08aa988b47805c53b78ac7 Author: Alexander V. Chernikov Date: Sat Feb 20 18:20:24 2021 +0000 Add arp/ndp tests in addition to rtsock ll tests. commit e5b394f2d0d94f190c9da2346fd22d7c6fb14730 Author: Alexander V. Chernikov Date: Sat Feb 20 18:21:52 2021 +0000 Fix setting static entries for arp/ndp. rtsock message validation changes committed in 2fe5a79425c7 did not take llinfo messages into account. Add a special validation case for RTA_GATEWAY llinfo messages. MFC after: 2 days commit 020f4112559ebf7e94665c9a69f89d21929ce82a Author: Ed Maste Date: Fri Jan 29 14:15:28 2021 -0500 bsdinstall: add knob to set ASLR sysctls Reviewed by: mw Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28418 commit fbc57e2df95b582f7d3287ed3919337bfec5711a Author: Ed Maste Date: Fri Jan 29 14:00:29 2021 -0500 bsdinstall: replace multiple ifs with case Reduce copy-paste and use a more typical construct. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28417 commit 504e64af32ba6c62fdcc894a3b1da76061c64796 Author: Guangyuan Yang Date: Sat Feb 20 08:03:15 2021 +0000 pwrite(2): add a BUGS section Add a BUGS section about using pwrite(2) when O_APPEND is set on the fd. MFC after: 3 days Submitted by: Ka Ho Ng Reviewed by: gbe, yuripv Differential Revision: https://reviews.freebsd.org/D28372 commit 150fc89a12a7e41b8e7f5777d2ed762f7e40ea92 Author: Mark Johnston Date: Fri Feb 19 21:44:20 2021 -0500 libdtrace: Trivial style fixes to force dt_lex.c to be regenerated After commit 8ba333e02e ("libdtrace: Stop relying on lex compatibility"), there have been several reports of incremental buildworlds failing since make does not know that dt_lex.c needs to be regenerated, and I want to avoid this when merging to stable/13. MFC with: 8ba333e02e commit 8cd1b2b1a7ab55e96aaf40a401d8792f2697b274 Author: Warner Losh Date: Fri Feb 19 15:34:25 2021 -0700 boot: remove gptboot.efifat, it never should have been conical hat reduction: Make sure we also remove gotboot.efifat. It was created, briefly, and shouldn't have existed in the first place. Kill it at the same place we kill boot1.efifat. Pointy Hat to: imp@ commit 038148c108c4e7251c52364616273eec72b0c061 Author: Navdeep Parhar Date: Fri Feb 19 14:22:08 2021 -0800 cxgbetool(8): Add support for setting the hashfilter mode (filter mask). Tighten up the validation of filter modes while here. Unrecognized keywords will be now be flagged as errors instead of being ignored. commit 0460a45062dfeb98b1f1f7a3a7b9268662b61545 Author: Navdeep Parhar Date: Fri Feb 19 14:18:08 2021 -0800 cxgbe(4): Use the correct filter width for T5+. T5 and above have extra bits for the optional filter fields. This is a correctness issue and not just a waste because a filter mode valid on a T4 (36b) may not be valid on a T5+ (40b). MFC after: 2 weeks Sponsored by: Chelsio Communications commit c91dda5ad923f24ef2e538b8dc180fa98598b4db Author: Navdeep Parhar Date: Fri Feb 19 13:47:18 2021 -0800 cxgbe(4): Add a driver ioctl to set the filter mask. Allow the filter mask (aka the hashfilter mode when hashfilters are in use) to be set any time it is safe to do so. The requested mask must be a subset of the filter mode already. The driver will not change the mode or ingress config just to support a new mask. MFC after: 2 weeks Sponsored by: Chelsio Communications commit 7ac8040a99319456c3225cd5166390f5bd172fdf Author: Navdeep Parhar Date: Fri Feb 19 13:05:19 2021 -0800 cxgbe(4): Use firmware commands to get/set filter configuration. 1. Query the firmware for filter mode, mask, and related ingress config instead of trying to figure them out from hardware registers. Read configuration from the registers only when the firmware does not support this query. 2. Use the firmware to set the filter mode. This is the correct way to do it and is more flexible as well. The filter mode (and associated ingress config) can now be changed any time it is safe to do so. The user can specify a subset of a valid mode and the driver will enable enough bits to make sure that the mode is maxed out -- that is, it is not possible to set another bit without exceeding the total width for optional filter fields. This is a hardware requirement that was not enforced by the driver previously. MFC after: 2 weeks Sponsored by: Chelsio Communications commit d4380c0cdd0517dc038403dd5c99242ce78bdeb5 Author: Jamie Gritton Date: Fri Feb 19 14:13:35 2021 -0800 jail: Change both root and working directories in jail_attach(2) jail_attach(2) performs an internal chroot operation, leaving it up to the calling process to assure the working directory is inside the jail. Add a matching internal chdir operation to the jail's root. Also ignore kern.chroot_allow_open_directories, and always disallow the operation if there are any directory descriptors open. Reported by: mjg Approved by: markj, kib MFC after: 3 days commit 0f9544d03e89d180f94a7a84b110ec7d2b6c625a Author: Mark Johnston Date: Fri Feb 19 17:08:34 2021 -0500 iflib: Fix detach of pseudo interfaces In commit 38bfc6dee33b we added an IFDI_DETACH() call to iflib_pseudo_deregister() since it looked like it was missing. One is present in the error-handling path of iflib_pseudo_register(). However, the detach actually comes from the DEVICE_DETACH() method for the above-mentioned device_t, so now we're calling IFDI_DETACH() twice when destroying a pseudo interface. Fix the problem by not calling IFDI_DETACH() from the device detach routine. This way we can ensure that iflib de-initialization always happens in a consistent order. It also ensures that you can't do silly things like "devctl detach ", which would previously detach the driver without tearing down the corresponding ifnet. PR: 253541 Reviewed by: erj MFC after: 1 week Fixes: 38bfc6dee33b Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28774 commit d2b3fadf2db56131376a71b0597876b591a6aee4 Author: Dimitry Andric Date: Fri Feb 19 19:18:22 2021 +0100 Revert 3c4fd2463bb2 since upstream libcxxrt fixed it in another way In 0ee0dbfb0d26cf4bc37f24f12e76c7f532b0f368 I imported a more recent libcxxrt snapshot, which includes an upstream fix for the padding of struct _Unwind_Exception: https://github.com/libcxxrt/libcxxrt/commit/e458560b7e22fff59af643dba363544b393bd8db However, we also had a similar fix in our tree as: https://cgit.freebsd.org/src/commit/?id=3c4fd2463bb29f65ef1404011fcb31e508cdf2e2 Since having both fixes makes the struct too large again, it leads to SIGBUSes when throwing exceptions on amd64 (or other LP64 arches). This is most easily tested by running kyua without any arguments. It looks like our fix is no longer needed now, so revert it to reduce diffs against upstream. PR: 253226 Reviewed by: arichardson, kp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D28799 commit f9e1cd6c99200846b324a8b65f7f31ded74013bd Author: Alexander V. Chernikov Date: Fri Feb 19 21:09:17 2021 +0000 Fix arp/ndp deletion broken by 2fe5a79425c7. Changes in the 2fe5a79425c7 moved dst sockaddr masking from the routing control plane to the rtsock code. It broke arp/ndp deletion. It turns out, arp/ndp perform RTM_GET request first to get an interface index necessary for the deletion. Then they simply stamp the reply with RTF_LLDATA and set the command to RTM_DELETE. As a result, kernel receives request with non-empty RTA_NETMASK and clears RTA_DST host bits before passing the message to the lla code. De facto, the only needed bits are RTA_DST, RTA_GATEWAY and the subset of rtm_flags. With that in mind, fix the interace by clearing RTA_NETMASK for every messages with RTF_LLDATA. While here, cleanup arp/ndp code a bit. MFC after: 1 day Reviewed by: gnn Differential Revision: https://reviews.freebsd.org/D28804 commit a78bb831a17f9ba4b3d833ae6a9c2ce4f5cb5d1e Author: Alfredo Dal'Ava Junior Date: Fri Feb 19 20:50:50 2021 -0300 fbio: Use appropriate types for the physical and virtual framebuffer address Use appropriate types for the physical and virtual framebuffer address. Fixes framebuffers mapped above 4G physical on 32-bit systems that support physical address extensions like i386 and Book-E powerpc. Patch developed by bdragon Reviewed by: bdragon, luporl Relnotes: yes Differential Revision: https://reviews.freebsd.org/D28604 commit 2ccf971ace0bf23a9b27ec886a7f013c47661052 Author: John Baldwin Date: Fri Feb 19 12:52:05 2021 -0800 iflib: Cast the result of iflib_netmap_txq_init() to void. This fixes a warning from GCC for kernels without netmap since the return value is never used. Reviewed by: vmaffione, erj Differential Revision: https://reviews.freebsd.org/D28598 commit 05d882b780f5be2da6f3d3bfef9160aacc4888d6 Author: Alexander Motin Date: Fri Feb 19 15:42:57 2021 -0500 Microoptimize CTL I/O queues. Switch OOA queue from TAILQ to LIST and change its direction, so that we traverse it forward, not backward. There is only one place where we really need other direction, and it is not critical. Use STAILQ_REMOVE_HEAD() instead of STAILQ_REMOVE() in backends. Replace few impossible conditions with assertions. MFC after: 1 month commit c3feaeaa32c9029ea98f2bb95c665390ca53728a Author: Robert Watson Date: Tue Feb 16 15:19:05 2021 +0000 Reimplement the arm64 dtrace_gethrtime(), which provides the high-resolution nanosecond timestamp used for the DTrace 'timestamp' built-in variable. The new implementation uses the EL0 cycle counter and frequency registers in ARMv8-A. This replaces a previous implementation that relied on an instrumentation-safe implementation of getnanotime(), which provided only timer resolution. MFC after: 3 days Reviewed by: andrew, bsdimp (older version) Useful comments appreciated: jrtc27, emaste commit 50b7c1f530f174be720b83f7e1d13e0fd42c5974 Author: Alfredo Dal'Ava Junior Date: Fri Feb 19 03:22:25 2021 -0300 ofwfb: fix incorrect colors on powerpc* and add new tunable parameters - Implements little-endian support (powerpc64le) - Adds 'hw.ofwfb.physaddr' kernel parameter so user can manually provide correct address if it's not detected correctly - Adds 'hw.ofwfb.argb32_pixel' so user can set it manually if colors are inverted due to incorrect pixel format (default = 1) - Automatically selects RGBA32 pixel format if NVidia graphic adapter is detected (sets hw.ofwfb.argb32_pixel=0) Machines equipped with NVidia graphic adapters tend to use RGBA32 pixel format. By default ARGB32 pixel format is used, proved to work on machines equipped with ATI graphic adapter and the onboard adapter used on Talos II and Blackbird machines from Raptor Computing Systems. Original patch developed by bdragon Reviewed by: bdragon, luporl MFC after: 3 days Relnotes: yes Differential Revision: https://reviews.freebsd.org/D28604 commit d765b211387c4c8a463086caeea8eb8836a50e57 Author: Andrew Turner Date: Fri Feb 19 15:22:13 2021 +0000 Remove __XSCALE__ checks from the arm code XScale support was removed over 2 years ago, remove the last __XSCALE__ checks from the arm MD code. Sponsored by: Innovate UK commit 853fd7a2e39802e46bd3d6476529796ac22412d9 Author: Richard Scheffenegger Date: Fri Feb 19 13:52:06 2021 +0100 Ensure cwnd doesn't shrink to zero with PRR Under some circumstances, PRR may end up with a fully collapsed cwnd when finalizing the loss recovery. Reviewed By: #transport, kbowling Reported by: Liang Tian MFC after: 1 week Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D28780 commit 248a47a4c2fb229ae815fa61875b3f62a2d6856c Author: Daniel Ebdrup Jensen Date: Thu Feb 18 22:50:54 2021 +0100 ports(7): Update instructions for package target Packages default to ending up in a different location compared to the documentation, so catch up to the implementation by referring to the location where packages can usually be found if no environment variables have been set. While here, also update the mention of the file extension to match the txz format that packages use. PR: 253179, 224370 Reported by: rwatson, jeromer at fastmail dotnet commit 4c0bef07be071a1633ebc86a653f9bd59d40796e Author: Kyle Evans Date: Wed Jan 20 22:02:04 2021 -0600 kern: net: remove TCP_LINGERTIME TCP_LINGERTIME can be traced back to BSD 4.4 Lite and perhaps beyond, in exactly the same form that it appears here modulo slightly different context. It used to be the case that there was a single pr_usrreq method with requests dispatched to it; these exact two lines appeared in tcp_usrreq's PRU_ATTACH handling. The only purpose of this that I can find is to cause surprising behavior on accepted connections. Newly-created sockets will never hit these paths as one cannot set SO_LINGER prior to socket(2). If SO_LINGER is set on a listening socket and inherited, one would expect the timeout to be inherited rather than changed arbitrarily like this -- noting that SO_LINGER is nonsense on a listening socket beyond inheritance, since they cannot be 'connected' by definition. Neither Illumos nor Linux reset the timer like this based on testing and inspection of Illumos, and testing of Linux. Reviewed by: rscheff, tuexen Differential Revision: https://reviews.freebsd.org/D28265 commit 812c9f48a2b7bccc31b2a6077b299822357832e4 Author: Alexander Motin Date: Thu Feb 18 22:07:32 2021 -0500 Save context switch per I/O for iSCSI and IOCTL frontends. Introduce new CTL core KPI ctl_run(), preprocessing I/Os in the caller context instead of scheduling another thread just for that. This call may sleep, that is not acceptable for some frontends like the original CAM/FC one, but iSCSI already has separate sleepable per-connection RX threads, and another thread scheduling is mostly just a waste of time. IOCTL frontend actually waits for the I/O completion in the caller thread, so the use of another thread for this has even less sense. With this change I can measure ~5% IOPS improvement on 4KB iSCSI I/Os to ZFS. MFC after: 1 month commit 4621c4f2fd179eff0923140da9af122c42dbe78b Author: Ed Maste Date: Thu Feb 18 20:41:33 2021 -0500 tests/sys/audit: force PIE off df093aa9463b linked against libprivateauditd.a, but that is currently (and incorrectly) built as position-dependent. For now just force PIE off for this test to fix the WITH_PIE build. Sponsored by: The FreeBSD Foundation commit 80ab50e1de19ca125f05a13937c796d48c4edd4a Author: Glen Barber Date: Thu Feb 18 18:52:39 2021 -0500 pass UNAME_r to fix building 14.x ports on 13.x MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") commit bdde49b7c7232c6936525f84ffb90856a7cd8e74 Author: Ravi Pokala Date: Tue Feb 16 00:03:32 2021 -0800 nvdimm(4): Export NVDIMM health flags via sysctl The ACPI NFIT specification defines a set of "NVDIMM State Flags". These flags are already reported by `acpidump -t', but this change makes them available on a per-device basis, in a format that is more easily parsed. To simplify this, introduce acpi_nfit_get_memory_maps_by_dimm(), which locates the (ACPI_NFIT_MEMORY_MAP)s associated with a given (nfit_handle_t). Reviewed by: mav, cem Tested by: mav, rpokala (version for stable/12) MFC after: 3 days Sponsored by: Panasas commit 2f48313ab26ef257ca8d46052a33fb6ad6abdb4f Author: Rick Macklem Date: Thu Feb 18 14:38:01 2021 -0800 nfs-over-tls: add rc scripts for rpc.tlsclntd and rpc.tlsservd Add rc.d scripts that control the recently committed rpc.tlsclntd(8) and rpc.tlsservd(8) daemons. Reviewed by: gbe MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28432 commit b9cbc85d727214cf3e13196ab7e7564e53037f77 Author: Rick Macklem Date: Thu Feb 18 14:08:19 2021 -0800 nfs-over-tls: add user space daemons rpc.tlsclntd and rpc.tlsservd The kernel changes needed for nfs-over-tls have been committed to main. However, nfs-over-tls requires user space daemons to handle the TLS handshake and other non-application data TLS records. There is one daemon (rpc.tlsclntd) for the client side and one daemon (rpc.tlsservd) for the server side, although they share a fair amount of code found in rpc.tlscommon.c and rpc.tlscommon.h. They use a KTLS enabled OpenSSL to perform the actual work and, as such, are only built when MK_OPENSSL_KTLS is set. Communication with the kernel is done via upcall RPCs done on AF_LOCAL sockets and the custom system call rpctls_syscall. Reviewed by: gbe (man pages only), jhb (usr.sbin/Makefile only) Comments by: jhb MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D28430 Relnotes: yes commit c67a2909a629db138227993e1093e66bb6c00af5 Author: Alexander Motin Date: Thu Feb 18 16:22:01 2021 -0500 Move XPT_IMMEDIATE_NOTIFY handling out of periph lock. It is a rare, but still better to not have lock dependencies. MFC after: 1 month commit 0ee0dbfb0d26cf4bc37f24f12e76c7f532b0f368 Merge: 04d2d2d7fd2 3f8a54b2089 Author: Dimitry Andric Date: Thu Feb 18 22:30:27 2021 +0100 Merge libcxxrt master 8049924686b8414d8e652cbd2a52c763b48e8456 Interesting fixes: b3c73ba libelftc_dem_gnu3: Sync with elftoolchain r3877 7b2335c Mostly fix __cxa_demangle after #3 Reported by: arichardson PR: 253226 MFC after: 3 days commit 04d2d2d7fd22bba638ccb5a0b2e0805087a70cd3 Author: Mitchell Horne Date: Wed Jan 20 11:07:53 2021 -0400 cgem: improve usage of busdma(9) KPI BUS_DMA_NOCACHE should only be used when one needs to guarantee the created mapping has uncached memory attributes, usually as a result of buggy hardware. Normal use cases should pass BUS_DMA_COHERENT, to create an appropriate mapping based on the flags passed to bus_dma_tag_create(). This should have no functional change, since the DMA tags in this driver are created without the BUS_DMA_COHERENT flag. Reported by: mmel Reviewed by: mmel, Thomas Skibo MFC after: 3 days commit 3f8a54b20893fe39cf81775e18be6c4353bd2a48 Author: Dimitry Andric Date: Thu Feb 18 22:07:28 2021 +0100 Import libcxxrt master 8049924686b8414d8e652cbd2a52c763b48e8456 Interesting fixes: b3c73ba libelftc_dem_gnu3: Sync with elftoolchain r3877 7b2335c Mostly fix __cxa_demangle after #3 commit cee8be2c78f15bed6d2339d41e3f8c232d41bb33 Author: Fernando Apesteguía Date: Thu Feb 18 19:04:23 2021 +0100 vis(1): Add EXAMPLES section Add three examples showing the use of `-h`, `-l`, `-t`, `-w` christos@netbsd.org to be notified. Reviewed by: bcr@, gbe@, imp@ Approved by: bcr@, gbe@ (mentor), imp@ Differential Revision: https://reviews.freebsd.org/D25242 commit acab1d58befaa8f42930bd62c26558e6005e1c13 Author: Fernando Apesteguía Date: Thu Feb 18 18:53:06 2021 +0100 mq_unlink(3): Add manual page Summary: Add a succinct manual page for mq_unlink Mostly borrowed from https://pubs.opengroup.org/onlinepubs/9699959099/ and hence, the disclaimer note at the bottom. PR: 243174 Reported by: rfg-freebsd@tristatelogic.com Reviewed by: gbe@, yuripv@ Approved by: gbe@ (mentor), yuripv@ Differential Revision: https://reviews.freebsd.org/D28593 commit a10020cfe2830e9626ac58ae97ecd12afb3553be Author: John Baldwin Date: Thu Feb 18 09:24:35 2021 -0800 cryptosoft: Support per-op keys for AES-GCM and AES-CCM. Reviewed by: cem Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D28752 commit 4dd6800e22b08fa1f756115600e9436818abb168 Author: John Baldwin Date: Thu Feb 18 09:24:26 2021 -0800 Add Chacha20-Poly1305 support in the OCF backend for KTLS. This supports Chacha20-Poly1305 for both send and receive for TLS 1.2 and for send in TLS 1.3. Reviewed by: gallatin Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D27841 commit 9c64fc40290e08f6dc6b75aa04084b04e48a61af Author: John Baldwin Date: Thu Feb 18 09:23:59 2021 -0800 Add Chacha20-Poly1305 as a KTLS cipher suite. Chacha20-Poly1305 for TLS is an AEAD cipher suite for both TLS 1.2 and TLS 1.3 (RFCs 7905 and 8446). For both versions, Chacha20 uses the server and client IVs as implicit nonces xored with the record sequence number to generate the per-record nonce matching the construction used with AES-GCM for TLS 1.3. Reviewed by: gallatin Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D27839 commit 1bd9fc96d4e4a26bb0060698c07b6f13d19cd819 Author: John Baldwin Date: Thu Feb 18 09:23:36 2021 -0800 cryptocheck: Add Chacha20-Poly1305 AEAD coverage. - Make openssl_gcm_encrypt generic to AEAD ciphers (aside from CCM) and use it for Chacha20-Poly1305. - Use generic AEAD control constants instead of GCM/CCM specific names. Reviewed by: cem Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D27838 commit dd2e1352b68aa33f7f6f8c19aaf88cf287013ae8 Author: John Baldwin Date: Thu Feb 18 09:22:18 2021 -0800 Add an implementation of CHACHA20_POLY1305 to cryptosoft. This uses the chacha20 IETF and poly1305 implementations from libsodium. A seperate auth_hash is created for the auth side whose Setkey method derives the poly1305 key from the AEAD key and nonce as described in RFC 8439. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D27837 commit fc8fc743d89388c0c5b97a491428fab2b36beac8 Author: John Baldwin Date: Thu Feb 18 09:21:56 2021 -0800 Add an OCF algorithm for ChaCha20-Poly1305 AEAD. Note that this algorithm implements the mode defined in RFC 8439. Reviewed by: cem Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D27836 commit cd6114d1a65cda09410e91ed4dc220df825a8ba2 Author: Mark Johnston Date: Thu Feb 18 10:59:43 2021 -0500 git-arc: Preserve the commit author when staging commits Reported by: jhb commit 57ba8673d7de509c9f2d23fdc1a5e179ff4ff3cc Author: Mark Johnston Date: Thu Feb 18 10:59:32 2021 -0500 git-arc: Globally save and restore the git checkout head This script uses -e, so it's prone to exiting in awkward places. In particular, if arc diff fails, the script just exits without restoring the checkout. Mitigate this for now by using a global variable to record the previous checkout and use a trap handler to restore it in the face of errors. A better solution might be to use arc diff's --head parameter but that will require more testing. Reported by: kevans Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D28631 commit 9976b42b697ce203b1d257b2a6fe64c8a2961645 Author: Thomas Skibo Date: Mon Jan 11 16:58:12 2021 -0400 ddb: fix show devmap output on 32-bit arm The output has been broken since 1b6dd6d772ca. Casting to uintmax_t before the call to printf is necessary to ensure that 32-bit addresses are interpreted correctly. PR: 243236 MFC after: 3 days commit 17d0f830dddf38724068f4139b6bef9a5dab70c5 Author: Mark Johnston Date: Thu Feb 18 10:50:57 2021 -0500 arm64: Include NUMA locality info in the CPU topology The scheduler uses this topology to try and preserve locality when migrating threads between CPUs and when performing work stealing. Ensure that on NUMA systems it will at least take the NUMA topology into account. Reviewed by: mmel Submitted by: Klara, Inc. Sponsored by: Ampere Computing MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D28579 commit 8c280db0b4d22ad92152bf05f941201428c80b87 Author: Allan Jude Date: Thu Feb 18 15:48:01 2021 +0000 ipmi_ssif: Fix inverted for the end of multi-part reads As per Intelligent Platform Management Interface Specification v2.0 rev. 1.1, section 12.5: SSIF Multi-part Read Transactions Sponsored by: Ampere Computing LLC Submitted by: Klara Inc. Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D28749 commit 37ef8d4cd6b570c0882e97826df961a5d6003d07 Author: Allan Jude Date: Thu Feb 18 15:47:17 2021 +0000 ig4(4): Increase timeout to about 1 second Per the i2c spec, a slave device can stretch SCL idefinitely, so 25ms is a bit arbitrary in general. smbus does specify an optional timeout recovery mechanism to be done at about 25~35ms, but the IPMI SSIF spec says that BMCs don't have any obligation to implement that. The BMC on Altra seems to mostly respond within 25ms, but occasionally will stretch SCL for ~300 msec. Also, the count_us mechanism seems to actually timeout around 25% earlier than it would claim (timeout really happening around 19ms instead of 25ms). Sponsored by: Ampere Computing LLC Submitted by: Klara Inc. Reviewed by: manu, imp Differential Revision: https://reviews.freebsd.org/D28747 commit 0577e39bec76b23aa099b68d5d1c832cc3823c38 Author: Fernando Apesteguía Date: Wed Feb 17 15:55:57 2021 +0100 Fix ibnd_* manpages sources Some ibnd_* manpages source other manpages from a `man3/` directory when it should reference the pages in the current directory. Instead of modifying contributing sources and using `.so` (discouraged by mandoc(1)) use MLINKS in the proper Makefile and do not install the affected manpages. PR: 237693 Reported by: wosch@FreeBSD.org Reviewed by: gbe@ (mentor) yuripv@ Approved by: gbe@ (mentor) yuripv@ Differential Revision: https://reviews.freebsd.org/D28727 commit 662283b1088d6488671b90ab18a66a997c526448 Author: Konstantin Belousov Date: Thu Feb 18 16:24:55 2021 +0200 vn_printf: handle VI_FOPENING Noted by: mjg Sponsored by: The FreeBSD Foundation MFC after: 6 days Fixes: fa3bd463cee commit 10f57cb98fd61b2669640a84aa73ad118601f281 Author: Martin Matuska Date: Thu Feb 18 12:08:20 2021 +0100 zfs: bump version and install new share files - bump version to 2.0.0-FreeBSD_gbf156c966 - install definition files for the new "-o compatibility" option to "zpool create" MFC after: 2 weeks commit ee36e25a86cbe2a9474c1d61f2c4b450da8ef952 Merge: fa2528ac643 62ceb3c592a Author: Martin Matuska Date: Thu Feb 18 15:17:31 2021 +0100 zfs: merge OpenZFS master-bf156c966 Notable upstream changes: bf156c966 Remove unused abd_alloc_scatter_offset_chunkcnt 658fb8020 Add "compatibility" property for zpool feature sets This update introduces a new pool property called "compatibility" that can be used to enable a limited set of pool features on pool creation and "stick" to it, so the "zpool upgrade" does not accidentally enable features that are not desired. The value of this property may then be changed later. See zpool-features(5) for more information about the "compatibility" pool property. Obtained from: OpenZFS MFC after: 2 weeks commit fa2528ac643519072c498b483d0dcc1fa5d99bc1 Author: Alex Richardson Date: Thu Feb 18 10:25:10 2021 +0000 Use atomic loads/stores when updating td->td_state KCSAN complains about racy accesses in the locking code. Those races are fine since they are inside a TD_SET_RUNNING() loop that expects the value to be changed by another CPU. Use relaxed atomic stores/loads to indicate that this variable can be written/read by multiple CPUs at the same time. This will also prevent the compiler from doing unexpected re-ordering. Reported by: GENERIC-KCSAN Test Plan: KCSAN no longer complains, kernel still runs fine. Reviewed By: markj, mjg (earlier version) Differential Revision: https://reviews.freebsd.org/D28569 commit df093aa9463b2121d8307fb91c4ba7cf17f4ea64 Author: Alex Richardson Date: Thu Feb 18 10:14:27 2021 +0000 tests/sys/audit: Avoid race caused by starting auditd(8) for testing In the CheriBSD CI we reproducibly see the first test in sys/audit (administrative:acct_failure) fail due to a missing startup message. It appears this is caused by a race condition when starting auditd: `service auditd onestart` returns as soon as the initial auditd() parent exits (after the daemon(3) call). We can avoid this problem by setting up the auditd infrastructure in-process: libauditd contains audit_quick_{start,stop}() functions that look like they are ideally suited to this task. This patch also avoids forking lots of shell processes for each of the 418 tests by using `auditon(A_SENDTRIGGER, &trigger, sizeof(trigger))` to check for a running auditd(8) instead of using `service auditd onestatus`. With these two changes (and D28388 to fix the XFAIL'd test) I can now boot and run `cd /usr/tests/sys/audit && kyua test` without any failures in a single-core QEMU instance. Before there would always be at least one failed test. Besides making the tests more reliable in CI, a nice side-effect of this change is that it also significantly speeds up running them by avoiding lots of fork()/execve() caused by shell scripts: Running kyua test on an AArch64 QEMU took 315s before and now takes 68s, so it's roughly 3.5 times faster. This effect is even larger when running on a CHERI-RISC-V QEMU since emulating CHERI instructions on an x86 host is noticeably slower than emulating AArch64. Test Plan: aarch64+amd64 QEMU no longer fail. Reviewed By: asomers Differential Revision: https://reviews.freebsd.org/D28451 commit cbcfe28f9d5f975f97b7fb4a0d72bc9780eb0c46 Author: Alex Richardson Date: Thu Feb 18 10:12:29 2021 +0000 libc/qsort: Don't allow interposing recursive calls This causes problems when using ASAN with a runtime older than 12.0 since the intercept does not expect qsort() to call itself using an interposable function call. This results in infinite recursion and stack exhaustion when a binary compiled with -fsanitize=address calls qsort. See also https://bugs.llvm.org/show_bug.cgi?id=46832 and https://reviews.llvm.org/D84509 (ASAN runtime patch). To prevent this problem, this patch uses a static helper function for the actual qsort() implementation. This prevents interposition and allows for direct calls. As a nice side-effect, we can also move the qsort_s checks to the top-level function and out of the recursive calls. Reviewed By: kib Differential Revision: https://reviews.freebsd.org/D28133 commit 2aa3ef285a23d802f0bd6c7281612e16834e9b68 Author: Alex Richardson Date: Thu Feb 18 10:07:51 2021 +0000 libc: Fix t_spawn_fileactions test after ATF update Since https://github.com/freebsd/atf/commit/4581cefc1e3811dd3c926b5dd4b15fd63d2e19da ATF opens the results file on startup. This fixes problems like capsicumized tests not being able to open the file on exit. However, this test closes all file descriptors above 3 to get a deterministic fd table allocation for the child. Instead of using closefrom (which will close the ATF output file FD) I've changed this test use the lowest available fd and pass that to the helper program as a string. We could also try to re-open the results file in ATF if we get a EBADF error, but that will fail when running under Capsicum. Reviewed By: cem Differential Revision: https://reviews.freebsd.org/D28684 commit 1c808fcd859f5ce24132a903a4c7c9996e0513b1 Author: Michal Krawczyk Date: Thu Feb 18 10:00:58 2021 +0100 Allocate BAR for ENA MSIx vector table In the new ENA-based instances like c6gn, the vector table moved to a new PCIe bar - BAR1. Previously it was always located on the BAR0, so the resources were already allocated together with the registers. As the FreeBSD isn't doing any resource allocation behind the scenes, the driver is responsible to allocate them explicitly, before other parts of the OS (like the PCI code allocating MSIx) will be able to access them. To determine dynamically BAR on which the MSIx vector table is present the pci_msix_table_bar() is being used and the new BAR is allocated if needed. Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc MFC after: 3 days commit e13e4fa6c4eba72de5c4685942de5dbe8f43db73 Author: Randall Stewart Date: Thu Feb 18 07:29:12 2021 -0500 fix Navdeeps LINT_NOINET error. commit fae028dd97d8fc8f9ba5153408b177481dbefd70 Author: Navdeep Parhar Date: Thu Feb 18 01:15:46 2021 -0800 cxgbe(4): Break up t4_read_chip_settings. Read the PF-only hardware settings directly in get_params__post_init. Split the rest into two routines used by both the PF and VF drivers: one that reads the SGE rx buffer configuration and another that verifies miscellaneous hardware configuration. MFC after: 1 week Sponsored by: Chelsio Communications commit 62ceb3c592a54fc54d9cb3beee91906979c3df14 Author: Martin Matuska Date: Thu Feb 18 10:14:16 2021 +0100 Update OpenZFS to master-bf156c966 Notable upstream changes: bf156c966 Remove unused abd_alloc_scatter_offset_chunkcnt 658fb8020 Add "compatibility" property for zpool feature sets commit 2ed689a674c380e48245933d5326da4dda65f94d Author: Kristof Provost Date: Thu Feb 18 08:36:46 2021 +0100 pf: Fix osfp configuration pf_rule_to_krule() incorrectly converted the rule osfp configuration to the krule structure. Reported by: delphij@ MFC after: 3 days commit 0a4f851074a3ca74cd4859c20e7d9807b2aeca65 Author: Randall Stewart Date: Thu Feb 18 01:27:30 2021 -0500 Fix another pesky missing #ifdef TCPHPTS commit f61e92ca5a23450bc28169bbdd71d7674df98c19 Author: Glen Barber Date: Wed Feb 17 23:00:03 2021 -0500 release: permanently remove the 'reldoc' target and associates Following 7b1d1a1658ffb69eff93afc713f9e88ed8b20eac, the structure for the reldoc target has significantly changed as result of the ASCIIDoctor/Hugo migration. As the release notes related files on the installation medium are inherently out of date, purge them entirely. Discussed within: re, doceng No objection: re (silence), doceng (silence) Timeout: 2 weeks MFC after: 1 week MFC to: stable/13, stable/12, and stable/11 only Sponsored by: Rubicon Communications, LLC ("Netgate") commit 4f4065e0a220a57afa03420d4f8fa97dbcb5644c Author: Robert Wing Date: Thu Jan 28 23:30:31 2021 -0900 libvmm: clean up vmmapi.h struct checkpoint_op, enum checkpoint_opcodes, and MAX_SNAPSHOT_VMNAME are not vmm specific, move them out of the vmmapi header. They are used for the save/restore functionality that bhyve(8) provides and are better suited in usr.sbin/bhyve/snapshot.h Since bhyvectl(8) requires these, the Makefile for bhyvectl has been modified to include usr.sbin/bhyve/snapshot.h Reviewed by: kevans, grehan Differential Revision: https://reviews.freebsd.org/D28410 commit 24fd63e0970f91189dd2acde987bd2e4c8c04a50 Author: John Baldwin Date: Wed Feb 17 16:34:23 2021 -0800 mips: Don't set __NO_TLS to disable some uses of TLS. __NO_TLS was originally added to disable use of _Thread in the locale code in libc in 82dd5016bd749d1d9e1531bd1703aebeecceab34. At the time libc did not support TLS on MIPS (I believe), but TLS support was added to libc (at least _set_tp.c) for MIPS about a month after __NO_TLS was added, but __NO_TLS was still left around. Reviewed by: imp Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D28713 commit dd176fd7e7b5aad231cd6ebf49fd14ae7394dfee Author: John Baldwin Date: Wed Feb 17 16:33:09 2021 -0800 riscv: Don't set __NO_TLS to disable some uses of TLS. __NO_TLS was originally added to disable use of _Thread in the locale code in libc in 82dd5016bd749d1d9e1531bd1703aebeecceab34. The initial RISC-V import set this for RISC-V presumably due to immaturity in the toolchains at the time. However, TLS via _Thread works fine in both GCC and clang on RISC-V. Reviewed by: mhorne, imp Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D28712 commit 67932460c7b6893a637a47d98d5f29d63e92c727 Author: John Baldwin Date: Wed Feb 17 16:32:11 2021 -0800 Add a VA_IS_CLEANMAP() macro. This macro returns true if a provided virtual address is contained in the kernel's clean submap. In CHERI kernels, the buffer cache and transient I/O map are allocated as separate regions. Abstracting this check reduces the diff relative to FreeBSD. It is perhaps slightly more readable as well. Reviewed by: kib Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D28710