]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
3 years agoDisable PIE for MIPS ubldr
Marcin Wojtas [Fri, 12 Feb 2021 15:41:49 +0000 (16:41 +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 <dgr@semihalf.com>
Reviewed by: emaste
Obtained from: Semihalf
Sponsored by: Stormshield
Differential Revision: https://reviews.freebsd.org/D28370

3 years agoiflib: introduce isc_dma_width
Marcin Wojtas [Wed, 24 Feb 2021 22:56:45 +0000 (23:56 +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 <ar@semihalf.com>
Obtained from: Semihalf
Sponsored by: Amazon, Inc.
Differential Revision: https://reviews.freebsd.org/D28706

3 years agoFix crash with rtadv-originated multipath IPv6 routes.
Alexander V. Chernikov [Wed, 24 Feb 2021 16:42:48 +0000 (16:42 +0000)]
Fix crash with rtadv-originated multipath IPv6 routes.

PR: 253800
Reported by: Frederic Denis <freebsdml at hecian.net>
MFC after: immediately

3 years agoatomic: add atomic_interrupt_fence()
Konstantin Belousov [Tue, 23 Feb 2021 22:12:29 +0000 (00:12 +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

3 years agopwm_backlight: Add MODULE_DEPEND on backlight
Brett Mastbergen [Mon, 22 Feb 2021 10:28:28 +0000 (10:28 +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 <brett.mastbergen@gmail.com>
MFC after: 3 days
PR:  253765

3 years agoAdd GPT PREP-boot type to mkimg(1) from geom_gpt.
Nathan Whitehorn [Wed, 24 Feb 2021 15:31:44 +0000 (10:31 -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.

3 years agoiflib: Avoid double counting in rxeof
Mark Johnston [Wed, 24 Feb 2021 15:08:53 +0000 (10:08 -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

3 years agoMount the ESP on /boot/efi in VM images.
Nathan Whitehorn [Wed, 24 Feb 2021 13:18:07 +0000 (08:18 -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.

3 years agoCall softdep_prealloc() before taking ffs_lock_ea(), if unlock is committing
Konstantin Belousov [Sun, 21 Feb 2021 10:11:54 +0000 (12:11 +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

3 years agoffs_close_ea: do not relock vnode under lock_ea
Konstantin Belousov [Sun, 21 Feb 2021 10:10:06 +0000 (12:10 +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

3 years agoffs_vnops.c: style
Konstantin Belousov [Sat, 20 Feb 2021 17:01:40 +0000 (19:01 +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

3 years agoffs: do not call softdep_prealloc() from UFS_BALLOC()
Konstantin Belousov [Thu, 18 Feb 2021 14:51:50 +0000 (16:51 +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

3 years agoffs_reallocblks: change the guard for softdep_prealloc() call to DOINGSUJ()
Konstantin Belousov [Fri, 19 Feb 2021 12:37:12 +0000 (14:37 +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

3 years agorc: fix parse of $local_startup
Cy Schubert [Wed, 24 Feb 2021 05:12:49 +0000 (21:12 -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

3 years agoUpdate manpage for AMD 10GbE driver
Rajesh Kumar M A [Wed, 24 Feb 2021 05:01:10 +0000 (05:01 +0000)]
Update manpage for AMD 10GbE driver

Approved by: vmaffione, gallatin

Differential Revision: https://reviews.freebsd.org/D28724

MFC after: 1 week

3 years agoDelete memstick images for PowerPC.
Nathan Whitehorn [Wed, 24 Feb 2021 03:17:20 +0000 (22:17 -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

3 years agormlock: Add a required compiler membar to the rlock slow path
Mark Johnston [Wed, 24 Feb 2021 02:15:50 +0000 (21:15 -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

3 years agopam_login_access: Fix negative entry matching logic
Mark Johnston [Tue, 23 Feb 2021 22:01:29 +0000 (17:01 -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

3 years agoRevert "ipmi_smbios: Deduplicate smbios entry point discovery logic"
Allan Jude [Tue, 23 Feb 2021 22:48:42 +0000 (22:48 +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.

3 years agoRevert "ipmi_smbios: remove unused smbios_cksum function"
Allan Jude [Tue, 23 Feb 2021 22:48:37 +0000 (22:48 +0000)]
Revert "ipmi_smbios: remove unused smbios_cksum function"

This reverts commit d2589dc3d56ce063b28b54df11c950c3758d9578.

3 years agoFix nd6 rib_action() handling.
Alexander V. Chernikov [Tue, 23 Feb 2021 22:31:07 +0000 (22:31 +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 <freebsdml@hecian.net>
MFC after: immediately

3 years agoig4: Add PCI IDs for Intel Gemini Lake I2C controller.
Vladimir Kondratyev [Tue, 23 Feb 2021 22:20:36 +0000 (01:20 +0300)]
ig4: Add PCI IDs for Intel Gemini Lake I2C controller.

Submitted by: Dmitry Luhtionov
MFC after: 2 weeks

3 years agorc.conf(5): Add note about parallel startup variable
Daniel Ebdrup Jensen [Tue, 23 Feb 2021 21:25:44 +0000 (22:25 +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

3 years agoipmi_smbios: remove unused smbios_cksum function
Allan Jude [Tue, 23 Feb 2021 21:24:12 +0000 (21:24 +0000)]
ipmi_smbios: remove unused smbios_cksum function

Sponsored By: Ampere Computing LLC
Submitted By: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D28751

3 years agoMount the EFI system partition (ESP) on newly-installed systems.
Nathan Whitehorn [Tue, 23 Feb 2021 21:16:52 +0000 (16:16 -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

3 years agoipmi_smbios: Deduplicate smbios entry point discovery logic
Allan Jude [Tue, 23 Feb 2021 21:17:37 +0000 (21:17 +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

3 years agosmbios: Move smbios driver out from x86 machdep code
Allan Jude [Tue, 23 Feb 2021 21:14:18 +0000 (21:14 +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

3 years agoBuild lib/msun tests with compiler builtins disabled
Dimitry Andric [Tue, 23 Feb 2021 20:03:32 +0000 (21:03 +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

3 years agoiicsmb: Request the bus recursively in bread()
Allan Jude [Tue, 23 Feb 2021 20:06:16 +0000 (20:06 +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

3 years agocamcontrol: change hueristic for I/O-less devtype
Warner Losh [Tue, 23 Feb 2021 19:33:26 +0000 (12:33 -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.

3 years agorelease(7) Fix mistake noted in review
Daniel Ebdrup Jensen [Tue, 23 Feb 2021 18:10:21 +0000 (19:10 +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
3 years agoRemove __NO_TLS.
Konstantin Belousov [Fri, 19 Feb 2021 15:20:29 +0000 (17:20 +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

3 years agorelease(7): Remove stray references to DOC* variables
Daniel Ebdrup Jensen [Tue, 23 Feb 2021 18:06:36 +0000 (19:06 +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

3 years agoclose_range: add audit support
Alex Richardson [Tue, 23 Feb 2021 17:47:07 +0000 (17:47 +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

3 years agotests/sys/netgraph: Tell kyua that perl is required
Alex Richardson [Tue, 23 Feb 2021 17:02:31 +0000 (17:02 +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

3 years agofind(1): Mark -not as an extensions to POSIX
Daniel Ebdrup Jensen [Tue, 23 Feb 2021 15:23:09 +0000 (16:23 +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 <bugcounterism at malbolge.net>

3 years agoBump CTL block backend threads from 14 to 32 per LUN.
Alexander Motin [Tue, 23 Feb 2021 15:58:56 +0000 (10:58 -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

3 years agostand/multiboot2: fix header length check
Roger Pau Monné [Tue, 23 Feb 2021 14:56:27 +0000 (15:56 +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')
3 years agostand/multiboot2: fix error message format
Roger Pau Monné [Tue, 23 Feb 2021 14:51:58 +0000 (15:51 +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')
3 years agobridge tests: Test STP on top of VLAN devices
Kristof Provost [Sat, 20 Feb 2021 09:13:33 +0000 (10:13 +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

3 years agoarp/nd: Cope with late calls to iflladdr_event
Kristof Provost [Mon, 22 Feb 2021 07:19:43 +0000 (08:19 +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

3 years agobridge: Remove members when assigned to a new vnet
Kristof Provost [Sun, 21 Feb 2021 20:20:32 +0000 (21:20 +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

3 years agobridge/stp: Ensure we enter NET_EPOCH whenever we can send traffic
Kristof Provost [Sun, 21 Feb 2021 20:18:46 +0000 (21:18 +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

3 years agobridge: Support STP on VLAN devices
Kristof Provost [Sat, 20 Feb 2021 09:11:30 +0000 (10:11 +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

3 years agoCreate dhclient pid directory if it doesn't exist
Chris Rees [Sun, 21 Feb 2021 18:56:56 +0000 (18:56 +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

3 years agorc: implement parallel boot
Rick Parrish [Sun, 7 Feb 2021 06:15:21 +0000 (07:15 +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

3 years agolib/msun/ctrig_test: Print the mismatched values on failure
Alex Richardson [Tue, 23 Feb 2021 09:38:57 +0000 (09:38 +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

3 years agoice_ddp: Update package file to 1.3.19.0
Eric Joyner [Tue, 23 Feb 2021 01:43:54 +0000 (17:43 -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 <erj@FreeBSD.org>
Sponsored by: Intel Corporation

3 years agojail: Don't allow jails under dying parents
Jamie Gritton [Tue, 23 Feb 2021 01:04:06 +0000 (17:04 -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

3 years agoamd64: import asm strlen into libc
Mateusz Guzik [Sun, 21 Feb 2021 21:20:04 +0000 (21:20 +0000)]
amd64: import asm strlen into libc

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D28845

3 years agojail: Fix a LOR introduced in 1158508a8086
Jamie Gritton [Mon, 22 Feb 2021 23:51:10 +0000 (15:51 -0800)]
jail: Fix a LOR introduced in 1158508a8086

3 years agoSimplify ifa/ifp refcounting in the routing stack.
Alexander V. Chernikov [Mon, 22 Feb 2021 21:42:27 +0000 (21:42 +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

3 years agoAdd if_try_ref() to simplify refcount handling inside epoch.
Alexander V. Chernikov [Mon, 22 Feb 2021 21:37:55 +0000 (21:37 +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

3 years agouma: Update the comment above startup_alloc() to reflect reality
Mark Johnston [Mon, 22 Feb 2021 23:21:49 +0000 (18:21 -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

3 years agocxgb(4): Rework my commit 9dc7c250.
Alexander Motin [Mon, 22 Feb 2021 22:21:05 +0000 (17:21 -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

3 years agouefi: Add riscv to historical details
Jessica Clarke [Mon, 22 Feb 2021 22:27:00 +0000 (22:27 +0000)]
uefi: Add riscv to historical details

3 years agoloader: autoload_font will hung loader when there is no local console
Toomas Soome [Sun, 21 Feb 2021 10:32:18 +0000 (12:32 +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

3 years agoRestore missing word
Warner Losh [Mon, 22 Feb 2021 21:39:04 +0000 (14:39 -0700)]
Restore missing word

"in" got dropped when I shuffled things around.

Noticed by: rpokala@
MFC After: 3 days

3 years agouefi: add historical details
Warner Losh [Mon, 22 Feb 2021 21:20:00 +0000 (14:20 -0700)]
uefi: add historical details

Add details about when armv6 and armv7 support was added.

3 years agovm_kern: Avoid sign extension in the KVA_QUANTUM definition
Mark Johnston [Mon, 22 Feb 2021 20:50:09 +0000 (15:50 -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

3 years agobhyve/snapshot: drop mkdir when creating the unix domain socket
Robert Wing [Fri, 19 Feb 2021 02:48:40 +0000 (17:48 -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

3 years agojail: Add PD_KILL to remove a prison in prison_deref().
Jamie Gritton [Mon, 22 Feb 2021 20:27:44 +0000 (12:27 -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

3 years agoRemove incorrect statement about EFI environment variables being unsupported.
Warner Losh [Mon, 22 Feb 2021 20:19:21 +0000 (13:19 -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

3 years agoFix possibly unitialized variables in __cxa_demangle_gnu3()
Dimitry Andric [Mon, 22 Feb 2021 20:01:09 +0000 (21:01 +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

3 years agoipfilter: Make LARGE_NAT a tunable.
Cy Schubert [Tue, 16 Feb 2021 15:44:07 +0000 (07:44 -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.

3 years agoRemove the redundant ipfilter IPv6 rc rules load.
Cy Schubert [Fri, 12 Feb 2021 15:17:32 +0000 (07:17 -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

3 years agoopenssh: document two changes that are now upstream
Ed Maste [Mon, 22 Feb 2021 19:03:28 +0000 (14:03 -0500)]
openssh: document two changes that are now upstream

These patches can be removed once we update to 8.5p1 or later.

3 years agoFix makefs bootstrap after d485c77f203fb0f4cdc08dea5ff81631b51d8809
Alex Richardson [Mon, 22 Feb 2021 17:49:05 +0000 (17:49 +0000)]
Fix makefs bootstrap after d485c77f203fb0f4cdc08dea5ff81631b51d8809

The makefs msdosfs code includes fs/msdosfs/denode.h which directly uses
struct buf from <sys/buf.h> 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

3 years agoCoalesce socket reads in software iSCSI.
Alexander Motin [Mon, 22 Feb 2021 17:23:35 +0000 (12:23 -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

3 years agoif_vtnet: Fix pointer-sign and used parameter warnings
Alex Richardson [Mon, 22 Feb 2021 17:26:21 +0000 (17:26 +0000)]
if_vtnet: Fix pointer-sign and used parameter warnings

Reviewed By: grehan
Differential Revision: https://reviews.freebsd.org/D28726

3 years agoUpdate libm tests from NetBSD
Alex Richardson [Mon, 22 Feb 2021 17:19:06 +0000 (17:19 +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

3 years agoFix for natd(8) sending wrong sequence number after TCP retransmission,
Hans Petter Selasky [Mon, 22 Feb 2021 10:58:46 +0000 (11:58 +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 <longwitz@incore.de>
PR: 230755
MFC after: 1 week
Sponsored by: Mellanox Technologies // NVIDIA Networking

3 years agoxen-blkback: fix leak of grant maps on ring setup failure
Roger Pau Monné [Wed, 20 Jan 2021 18:40:51 +0000 (19:40 +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

3 years agogit hooks: add "Fixes" trailer to commit message template
Ed Maste [Sat, 20 Feb 2021 18:49:31 +0000 (13:49 -0500)]
git hooks: add "Fixes" trailer to commit message template

A number of projects use "Fixes: <hash>" to identify a commit that is
fixed by a given change.  Adopt that convention.

Differential Revision: https://reviews.freebsd.org/D28693

3 years agom_uiotombuf_nomap(): Stop clearing PG_ZERO in newly allocated pages
Mark Johnston [Mon, 22 Feb 2021 15:03:37 +0000 (10:03 -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

3 years agoAdd missing entry for zfs_racct.c
Stefan Eßer [Mon, 22 Feb 2021 14:06:48 +0000 (15:06 +0100)]
Add missing entry for zfs_racct.c

3 years agozfs: merge OpenZFS master-9312e0fd1
Martin Matuska [Mon, 22 Feb 2021 11:35:56 +0000 (12:35 +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

3 years agoFix build after 2c7dc6bae9fd.
Alexander Motin [Sun, 21 Feb 2021 22:21:14 +0000 (17:21 -0500)]
Fix build after 2c7dc6bae9fd.

MFC after: 1 month

3 years agoRefactor CTL datamove KPI.
Alexander Motin [Sun, 21 Feb 2021 21:45:14 +0000 (16:45 -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

3 years agojail: Add pr_state to struct prison
Jamie Gritton [Sun, 21 Feb 2021 21:24:47 +0000 (13:24 -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

3 years agovfs: shrink struct vnode to 448 bytes on LP64
Mateusz Guzik [Sun, 21 Feb 2021 19:48:49 +0000 (19:48 +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.

3 years agojail: fix build after the previous commit
Mateusz Guzik [Sun, 21 Feb 2021 19:57:21 +0000 (19:57 +0000)]
jail: fix build after the previous commit

Noted by: Michael Butler <imb protected-networks.net>

3 years agoUpdate vendor/openzfs to master-9312e0fd1
Martin Matuska [Sun, 21 Feb 2021 20:22:07 +0000 (21:22 +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)

3 years agojail: Change the locking around pr_ref and pr_uref
Jamie Gritton [Sun, 21 Feb 2021 18:55:44 +0000 (10:55 -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

3 years agosctp: improve computation of an alternate net
Michael Tuexen [Sun, 21 Feb 2021 16:13:06 +0000 (17:13 +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

3 years agosctp: clear a pointer to a net which will be removed
Michael Tuexen [Sun, 21 Feb 2021 12:03:57 +0000 (13:03 +0100)]
sctp: clear a pointer to a net which will be removed

MFC after: 3 days

3 years agoext2fs: clear write cluster tracking on truncation
Konstantin Belousov [Wed, 17 Feb 2021 12:35:56 +0000 (14:35 +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

3 years agovnode: move write cluster support data to inodes.
Konstantin Belousov [Mon, 15 Feb 2021 04:35:59 +0000 (06:35 +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

3 years agoRemove #define _KERNEL hacks from libprocstat
Konstantin Belousov [Thu, 18 Feb 2021 13:43:58 +0000 (15:43 +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

3 years agoDelete dead CLUSTERDEBUG config option.
Konstantin Belousov [Thu, 18 Feb 2021 09:12:26 +0000 (11:12 +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

3 years agopci_vendors: update to 2021.02.20
Baptiste Daroussin [Sun, 21 Feb 2021 05:09:03 +0000 (06:09 +0100)]
pci_vendors: update to 2021.02.20

3 years agotermcap: add an entry for the foot terminal
Baptiste Daroussin [Sun, 14 Feb 2021 05:57:37 +0000 (06:57 +0100)]
termcap: add an entry for the foot terminal

MFC after: 3 days

3 years agovfs: employ vfs_ref_from_vp in statfs and fstatfs
Mateusz Guzik [Mon, 15 Feb 2021 22:08:20 +0000 (23:08 +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

3 years agovfs: add vfs_ref_from_vp
Mateusz Guzik [Mon, 15 Feb 2021 22:08:40 +0000 (23:08 +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

3 years agoamd64: implement strlen in assembly, take 2
Mateusz Guzik [Sun, 21 Feb 2021 00:42:26 +0000 (00:42 +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

3 years agojail: Improve locking when removing prisons
Jamie Gritton [Sat, 20 Feb 2021 22:38:58 +0000 (14:38 -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

3 years agoPRR: use accurate rfc6675_pipe when enabled
Richard Scheffenegger [Sat, 20 Feb 2021 19:10:00 +0000 (20:10 +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

3 years agoAdd arp/ndp tests in addition to rtsock ll tests.
Alexander V. Chernikov [Sat, 20 Feb 2021 18:20:24 +0000 (18:20 +0000)]
Add arp/ndp tests in addition to rtsock ll tests.

3 years agoFix setting static entries for arp/ndp.
Alexander V. Chernikov [Sat, 20 Feb 2021 18:21:52 +0000 (18:21 +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

3 years agobsdinstall: add knob to set ASLR sysctls
Ed Maste [Fri, 29 Jan 2021 19:15:28 +0000 (14:15 -0500)]
bsdinstall: add knob to set ASLR sysctls

Reviewed by: mw
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D28418