Commit graph

289031 commits

Author SHA1 Message Date
Konstantin Belousov 2a284076ec kern_openat(): rename fd argument to dirfd
Reviewed by:	markj, pjd
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D43529
2024-01-24 07:13:25 +02:00
Konstantin Belousov 38bfddf597 regen 2024-01-24 07:11:27 +02:00
Konstantin Belousov f006524d6d kcmp(2): implement for procdesc
Reviewed by:	brooks, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D43518
2024-01-24 07:11:27 +02:00
Konstantin Belousov 41fb6dc3d4 kcmp(2): implement for linuxkpi cdevs
Reviewed by:	brooks, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D43518
2024-01-24 07:11:27 +02:00
Konstantin Belousov 5c41d888de kcmp(2): implement for devfs files
Compare not vnodes, which are different between mount points, but
actual cdev referenced by the devfs node.

Reviewed by:	brooks, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D43518
2024-01-24 07:11:26 +02:00
Konstantin Belousov f04220c1b0 kcmp(2): implement for vnode files
Reviewed by:	brooks, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D43518
2024-01-24 07:11:26 +02:00
Konstantin Belousov f28526e946 kcmp(2): implement for generic file types
Reviewed by:	brooks, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D43518
2024-01-24 07:11:26 +02:00
Konstantin Belousov 211bdd601e Add kcmp(2) userspace bits
Unlike Linux, we do provide libc wrapper.  All definitions and
prototypes are available from <unistd.h>

Tested by:	manu
Reviewed by:	brooks, markj
Sponsored by:   The FreeBSD Foundation
MFC after:      1 week
Differential revision:  https://reviews.freebsd.org/D43518
2024-01-24 07:11:26 +02:00
Konstantin Belousov d8decc9ae3 Add kcmp(2) kernel bits
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
2024-01-24 07:11:26 +02:00
Konstantin Belousov 168c7580c6 file: add fo_cmp method
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
2024-01-24 07:11:26 +02:00
Konstantin Belousov 58d3171698 Add fget_remote()
The function holds and returns struct file for a file descriptor index
in the given process.

Reviewed by:	brooks, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D43518
2024-01-24 07:11:26 +02:00
Konstantin Belousov 24fee9771e sys/file.h: style
Reviewed by:	brooks, markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D43518
2024-01-24 07:11:25 +02:00
Kyle Evans 009db0d40c 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
2024-01-23 23:00:36 -06:00
Pawel Jakub Dawidek a4bf6baaeb
Fix file descriptor leak on pool import.
Descriptor leak can be easily reproduced by doing:

	# zpool import tank
	# sysctl kern.openfiles
	# zpool export tank; zpool import tank
	# sysctl kern.openfiles

We were leaking four file descriptors on every import.

Similar leak most likely existed when using file-based VDEVs.

External-issue: https://reviews.freebsd.org/D43529
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Closes #15630
2024-01-23 15:03:48 -08:00
Gleb Smirnoff 90ad2dc287 tcp: remove 20+ year old disabled code from d912c694ee 2024-01-23 13:16:34 -08:00
Gleb Smirnoff c809435b18 tcp: clear outdated comment mentioning T/TCP 2024-01-23 12:59:21 -08:00
Gleb Smirnoff e21c668719 tcp: pass positive errno to tcp_drop()
Fixes:	446ccdd08e
2024-01-23 12:59:21 -08:00
Mike Karels 2e68c5a44c 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.
2024-01-23 12:46:31 -06:00
Dimitry Andric 2acd158d4b mtree: stop creating old mixer(8) test directories
The tests themselves were added to ObsoleteFiles.inc in commit
f7c4f49649, but not yet removed from BSD.tests.dist.

PR:		274602
Fixes:		f7c4f49649
2024-01-23 19:40:12 +01:00
John Baldwin a82470212b powerpc: Add RF_LITTLEENDIAN resource flag
If this powerpc-specific flag is set on a resource, then the
little-endian bus tag is always used when mapping that resource.

Make use of this flag in the mpc85xx/fsl_sata driver to avoid setting
the SATA BAR's bus tag after bus_alloc_resource.

Reviewed by:	jhibbits
Differential Revision:	https://reviews.freebsd.org/D43553
2024-01-23 09:38:36 -08:00
John Baldwin 3cf553288b simplebus: Consistently map SYS_RES_IOPORT to SYS_RES_MEMORY
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D43442
2024-01-23 09:38:25 -08:00
John Baldwin 0b60d7a600 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.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D43441
2024-01-23 09:38:09 -08:00
John Baldwin a3d6e0de1c 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.

Reviewed by:	jhibbits
Differential Revision:	https://reviews.freebsd.org/D43440
2024-01-23 09:37:53 -08:00
John Baldwin e5c6dbd576 arm64 thunder: Use bus_generic_rman_* in the pcie_pem driver
- Implement bus_map/unmap_resource pulling bits from the previous
  thunder_pem_activate/deactivate_resource.

- Use bus_generic_rman_* in various routines for memory and I/O port
  resources.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D43439
2024-01-23 09:37:41 -08:00
John Baldwin 4e1d94d997 arm mv_pcib: Use bus_generic_rman_*
- Implement bus_get_rman pulling bits from mv_pcib_alloc_resource.

- Implement bus_map/unmap_resource pulling bits from
  mv_pcib_activate/deactivate_resource.

- Use bus_generic_rman_* to handle memory and I/O resources for
  mv_pcib_alloc/activate/adjust/deactivate/release_resource.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D43438
2024-01-23 09:37:30 -08:00
John Baldwin faeb273e7a 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.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D43437
2024-01-23 09:37:13 -08:00
John Baldwin 7b5a5e4eef powerpc nexus: Use bus_generic_rman_*
Reviewed by:	imp, jhibbits
Differential Revision:	https://reviews.freebsd.org/D43436
2024-01-23 09:37:02 -08:00
John Baldwin af081ec6f7 powerpc powermac: Use bus_generic_rman_*
Implement bus_map/unmap_resource and add bus_get_rman for use by
bus_generic_rman_*.

Reviewed by:	imp, jhibbits
Differential Revision:	https://reviews.freebsd.org/D43435
2024-01-23 09:36:49 -08:00
John Baldwin 5a7e717fb7 powerpc mpc85xx: Use bus_generic_rman_*
- Consistently map SYS_RES_IOPORT to SYS_RES_MEMORY for
  bus_activate/deactivate/adjust/release_resource.

- Implement bus_map/unmap_resource.

- Add an implementation of bus_adjust_resource.

Reviewed by:	jhibbits
Differential Revision:	https://reviews.freebsd.org/D43434
2024-01-23 09:36:37 -08:00
John Baldwin d7c16b3334 powerpc psim: Use bus_generic_rman_*
- Split out bits of iobus_activate/deactive_resource to implement
  iobus_map/unmap_resource.

- Use bus_generic_rman_* methods in several bus methods to handle
  memory and I/O port resources.

- Add an implementation of bus_adjust_resource.

Reviewed by:	imp, jhibbits
Differential Revision:	https://reviews.freebsd.org/D43433
2024-01-23 09:36:26 -08:00
John Baldwin 3dd55df982 powerpc ps3bus: Use bus_generic_rman_*
- Split out part of ps3bus_activate_resource into a
  ps3bus_map_resource method.

- Implement ps3bus_unmap_resource via pmap_unmapdev.

- Use bus_generic_rman_* to add bus_adjust_resource,
  bus_deactivate_resource, and bus_release_resource methods.

Reviewed by:	imp, jhibbits
Differential Revision:	https://reviews.freebsd.org/D43432
2024-01-23 09:36:12 -08:00
John Baldwin 9c4effb106 hyperv vmbus_pcib: Use pci_domain_*_bus for PCI_RES_BUS resources
Specifically for bus_activate/adjust/deactivate_bus methods.

Differential Revision:	https://reviews.freebsd.org/D43431
2024-01-23 09:35:58 -08:00
John Baldwin 31e15e531c x86: Use pci_domain_[de]activate_bus for PCI_RES_BUS resources
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D43430
2024-01-23 09:35:47 -08:00
John Baldwin e9eb353b32 pci_host_generic: Use pci_domain_[de]activate_bus for PCI_RES_BUS resources
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D43429
2024-01-23 09:35:36 -08:00
John Baldwin c2d4fef658 acpi_pcib: Use pci_domain_[de]activate_bus for PCI_RES_BUS resources
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D43428
2024-01-23 09:35:22 -08:00
John Baldwin 23e3b83ab6 pcib: Add helper routines for [de]activating PCI_RES_BUS resources
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D43427
2024-01-23 09:35:08 -08:00
Mark Johnston 5f086566e0 bhyve: Prepare to add arm64 support to the gdb stub
In particular:
- Stop assuming that the breakpoint size is one byte.
- Avoid referencing the "rip" field in machine-independent code, use a
  helper.

No functional change intended.

Reviewed by:	corvink, jhb
MFC after:	1 week
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D43483
2024-01-23 11:41:13 -05:00
Mark Johnston 5e728af444 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.

No functional change intended.

Reviewed by:	corvink, jhb
MFC after:	1 week
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D43481
2024-01-23 11:40:52 -05:00
Mark Johnston cfa2c78aee bhyve: Avoid underflows when handling remote commands
Reviewed by:	corvink, jhb
MFC after:	1 week
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D43480
2024-01-23 11:40:40 -05:00
Igor Ostapenko 380b7eb309 sysctl.8: fix format typo
Signed-off-by: Igor Ostapenko <pm@igoro.pro>
2024-01-23 16:40:14 +01:00
Christos Margiolis 9f550134a4 acpiconf: remove trailing space in "Mesurement Accuracy" output
No functional change intended.

MFC after: 1 week
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D43561
2024-01-23 17:39:40 +02:00
Dag-Erling Smørgrav 7edbf69b79 stand: Add 1440p to the list of known resolutions.
MFC after:	1 week
Reviewed by:	manu, kevans, imp
Differential Revision:	https://reviews.freebsd.org/D43391
2024-01-23 15:20:27 +01:00
Elliott Mitchell a8b2189c90 arm/mpic: remove empty pic_init_secondary() hook
The default hook does nothing, so having an empty handler is pointless.
Simple cleanup.

Reviewed by:	markj
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D40475
2024-01-23 02:52:37 +00:00
Ed Maste 3f4f82c0d7 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.

PR:		276517
2024-01-22 21:17:23 -05:00
Brian Behlendorf 435b173fd9
ZTS: Apply zfs_bclone_enabled to bclone tests
If block cloning is disabled by default then enable it when running
the bclone tests.  Follow up to #15529.

Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #15796
2024-01-22 16:14:08 -08:00
Gordon Bergling e125371fb6 dwc: Fix two typos in a source code comment
- s/recevied/received/
- s/descriptr/descriptor/

MFC after:	3 days
2024-01-22 22:03:29 +01:00
Gordon Bergling ad92f3d9d0 meta2deps.py: Fix a typo in a source code comment
- s/follwing/following/

MFC after:	3 days
2024-01-22 22:00:36 +01:00
Gordon Bergling 97a4045aaf virtio(4): Fix a typo in a source code comment
- s/recevied/received/

MFC after:	3 days
2024-01-22 21:59:06 +01:00
Gordon Bergling d743711016 usb: Fix a typo in a source code comment
- s/recevied/received/

MFC after:	3 days
2024-01-22 21:57:06 +01:00
Gordon Bergling b2c48aa4d1 vmd(4): Fix typos in source code comments
- s/harwdare/hardware/

MFC after:	3 days
2024-01-22 21:55:33 +01:00