This is based purely on reading the Linux kcmp(2) man page.
In addition to the Linux set of comparators, I also added KCMP_FILEOBJ to
compare underlying file' objects.
Tested by: manu
Reviewed by: brooks, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D43518
The method should return 0 if the file' underlying objects are same. In
other words, if 0 is returned, io from either of file causes
modifications of the same object.
Reviewed by: brooks, markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D43518
Kyle Evans [Wed, 24 Jan 2024 05:00:36 +0000 (23:00 -0600)]
ncurses: serialize the tinfo build a little bit
Move ncurses_dll.h to GENHDRS to start with; it's been generated from
ncurses_dll.h.in for years, so it's not actually in a different category
than all of the other GENHDRS. Slap an .ORDER on it to ensure that we
build ncurses_dll.h and curses.h before any *.c gets compiled.
This should sufficiently address a build race seen downstream where
ncurses_dll.h is present but not yet populated.
Reviewed by: bapt
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D43540
Mike Karels [Tue, 23 Jan 2024 17:23:38 +0000 (11:23 -0600)]
tmpfs: increase vfs.tmpfs.memory_percent to 100 as workaround
The changes to avoid letting tmpfs use all of memory + swap do not
work well with ZFS ARC. The ARC can grow quite large, and will shrink
when there is memory pressure, but tmpfs does not allow for that.
Pending investigation of the right way to handle this, change the
default value of the vfs.tmpfs.memory_percent sysctl to 100 as a
workaround. The sysctl can be set to 95 to get back to the previous
default.
John Baldwin [Tue, 23 Jan 2024 17:38:09 +0000 (09:38 -0800)]
ofw_pcib: Use bus_generic_rman_*
- Implement bus_map/unmap_resource pulling bits from the previous
ofw_pcib_activate/deactivate_resource. One difference here is that
the bus_unmap_resource implementation uses bus_space_unmap instead
of pmap_unmapdev as a complement to the existing use of bus_space_map.
- Use bus_generic_rman_* in various routines for memory and I/O port
resources.
- Use pci_domain_* for PCI_RES_BUS in
ofw_pcib_activate/deactivate_resource.
John Baldwin [Tue, 23 Jan 2024 17:37:53 +0000 (09:37 -0800)]
powerpc: Fix bus_space_unmap
Previously it failed to compile since the macro passed too many
arguments to the function. Fix by adding the bus handle to the
function and adding an implementation that calls pmap_unmapdev.
John Baldwin [Tue, 23 Jan 2024 17:37:13 +0000 (09:37 -0800)]
arm nexus: Use bus_generic_rman_*
- Implement bus_get_rman pulling bits from nexus_alloc_resource.
- Implement bus_map/unmap_resource pulling bits from
nexus_activate/deactivate_resource.
- Use bus_generic_rman_* for
bus_alloc/adjust/activate/deactivate/release_resource except for
custom interrupt activate/deactivate logic still in
nexus_activate/deactivate_resource.
Mark Johnston [Tue, 23 Jan 2024 16:40:52 +0000 (11:40 -0500)]
bhyve: Simplify register definitions a bit
It's awkward to have separate tables for information which is logically
connected. Merge the gdb_regset[] and gdb_regsize[] arrays and update
gdb_read_regs() to cope with the result. This makes the addition of
arm64 support a bit cleaner.
Ed Maste [Tue, 23 Jan 2024 02:05:58 +0000 (21:05 -0500)]
bsdlabel: limit to 8 partitions
bsdlabel is intended to support up to 20 partitions, but the disklabel
struct has a d_partitions array with only BSD_NPARTS_MIN (8) entries.
Previously, an attempt to operate on a bsdlabel with more than eight
partitions resulted in a buffer overflow.
As a stopgap limit bsdlabel to 8 partitions until this is fixed
properly.
Kristof Provost [Mon, 22 Jan 2024 16:35:54 +0000 (17:35 +0100)]
pflow: limit to no more than 128 flow exporters
While there are no inherent limits to the number of exporters we're
likely to scale rather badly to very large numbers. There's also no
obvious use case for more than a handful. Limit to 128 exporters to
prevent foot-shooting.
Aaron LI [Mon, 22 Jan 2024 16:18:56 +0000 (10:18 -0600)]
wg: detach bpf upon destroy as well
bpfattach() is called in wg_clone_create(), but the bpfdetach() is
missing from wg_close_destroy(). Add the missing bpfdetach() to avoid
leaking both the associated bpf bits as well as the ifnet that bpf will
hold a reference to.
Kristof Provost [Wed, 17 Jan 2024 17:11:27 +0000 (18:11 +0100)]
pf: work around icmp6 packet-too-big not being sent when binat-ing
If we're applying NPTv6 we pass a packet with a modified source and/or
destination address to the network stack.
If that packet then turns out to be larger than the MTU of the sending
interface the stack will attempt to generate an icmp6 packet-too-big
error, but may fail to look up the appropriate source address for that
error message. Even if it does, pf would still have to undo the binat
operation inside the icmp6 packet so the sending host can make sense of
the error.
We can avoid both problems entirely by having pf also perform the MTU
check (taking the potential refragmentation into account), and
generating the icmp6 error directly in pf.
Alexander Ziaee [Fri, 12 Jan 2024 22:12:48 +0000 (17:12 -0500)]
newfs_msdos.8: example for specific cluster size
The usual use case in 2024 for newfs_msdosfs is creating filesystems on SD cards
for older hardware. In most tutorials, they call the cluster size "allocation
size". Therefore, add a small note next to cluster size that it is also called
allocation size, and add an example for how to do this.
Cy Schubert [Sat, 20 Jan 2024 13:52:35 +0000 (05:52 -0800)]
rc.d/kdc: Support start of MIT krb5kdc
Some users wishing to use the MIT krb5kdc have discovered the
kdc script workaround applied to the MIT krb5 ports is insufficient.
Let's build into this rc script the smarts to determine whether
base or ports Hiemdal kdc is being invoked or the MIT krb5kdc.
While at it, remove kdc_start_precmd(). This will simplify a future
jail patch.
Warner Losh [Sat, 20 Jan 2024 04:32:16 +0000 (21:32 -0700)]
firmware(9): Update example
Update the example to include a firmware module in the kernel from npe
to iwn. Npe was deleted 6 years ago so makes a poor example of how to
embed firmware in the kernel.
Jessica Clarke [Sat, 20 Jan 2024 22:07:48 +0000 (22:07 +0000)]
tools/build/make.py: Add missing comma to fix tinderbox and worlds
The missing comma meant this was interpreted as a single target called
"tinderboxworlds", and so neither tinderbox nor worlds were recognised
as being MI targets (i.e. still required TARGET(_ARCH) to be given).
Fixes: 5157b451c654 ("tools/build/make.py: Grow the list of MI targets")
Mark Johnston [Fri, 19 Jan 2024 19:06:16 +0000 (14:06 -0500)]
makefs: Make it possible to silence warnings about duplicate paths
When generating a VM image from an installworld mtree manifest, makefs
spits out several thousand warnings about duplicate paths in the
manifest. These are harmless and have been around for a long time (see
the phabricator revision for some more details), so let's at least have
a way to make makefs quieter.
Mark Johnston [Thu, 18 Jan 2024 21:47:52 +0000 (16:47 -0500)]
mlx5: Zero DMA memory mlx5_alloc_cmd_msg() and alloc_cmd_page()
These functions may map more memory for DMA than is actually used, since
the allocator operates on multiples of a 4KB page size. Thus,
bus_dmamap_sync() can trigger KMSAN reports when the unused portion of
a page is not zero-ed.