Commit Graph

279975 Commits

Author SHA1 Message Date
Emmanuel Vadot
6933abc3e4 pkgbase: Stop adding FreeBSD-runtime as a dep for every package
shlib_required/provided is enough for the dependencies and this also
causes problems for packages like rescue which shouldn't depend on runtime
at all.

PR:	268063
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-12-08 20:02:41 +01:00
Baptiste Daroussin
07d1c4a919 pci_info: update to 2022-12-04 2022-12-08 16:08:24 +01:00
Doug Rabson
5eeb4f737f imgact_binmisc: Optionally pre-open the interpreter vnode
This allows the use of chroot and/or jail environments which depend on
interpreters registed with imgact_binmisc to use emulator binaries from
the host to emulate programs inside the chroot.

Reviewed by:	imp
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D37432
2022-12-08 14:32:03 +00:00
Michael Tuexen
cef3c4e0ba ppp: improve MSS clamping
ppp supports MSS clamping for TCP/IPv4. This patch
* improves MSS clamping for TCP/IPv4 by using the MSS as specified
  in RFC 6691.
* adds support for MSS clamping for TCP/IPv6.

Reported by:		Timo Voelker
Reviewed by:		thj
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D37624
2022-12-08 09:48:29 +01:00
John Baldwin
70bb22868d ktls_test: Add debug option to hexdump keys, nonces, and buffers.
Reviewed by:	markj
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D37509
2022-12-07 16:57:28 -08:00
John Baldwin
4eda35b636 atp: Fix mismatch in array bounds.
Reported by:	GCC -Warray-parameter
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D37552
2022-12-07 12:33:56 -08:00
John Baldwin
183783d34a if_rsu: Fix mismatches in array bounds.
Reported by:	GCC -Warray-parameter
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D37551
2022-12-07 12:33:41 -08:00
John Baldwin
8bc615f591 rtwn: Fix mismatches in array bounds.
Reported by:	GCC -Warray-parameter
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D37550
2022-12-07 12:33:21 -08:00
John Baldwin
47cc457bd6 mlx5: Fix mismatch in array bounds.
Reported by:	GCC -Warray-parameter
Reviewed by:	hselasky, imp, emaste (earlier version)
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D37549
2022-12-07 12:32:54 -08:00
John Baldwin
415ccf5112 ipfilter: Fix mismatch in array bounds.
Reported by:	GCC -Warray-parameter
Reviewed by:	imp, cy, emaste
Differential Revision:	https://reviews.freebsd.org/D37548
2022-12-07 12:32:38 -08:00
John Baldwin
d256a06fe8 aesni: Remove misleading array bounds for aesni_decryt_ecb.
All the other functions used pointers for from/to instead of
fixed-size array parameters.  More importantly, this function can
accept pointers to buffers of multiple blocks, not just a single
block.

Reported by:	GCC -Warray-parameter
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D37547
2022-12-07 12:32:19 -08:00
John Baldwin
1f07812095 net80211: Fix mismatches in array bounds.
Reported by:	GCC -Warray-parameter
Reviewed by:	imp, emaste (earlier version)
Differential Revision:	https://reviews.freebsd.org/D37546
2022-12-07 12:31:53 -08:00
John Baldwin
fb4a86164d ocs: Fix mismatch in array bounds.
Reported by:	GCC -Warray-parameter
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D37545
2022-12-07 12:31:33 -08:00
John Baldwin
8b45e0c180 malo: Fix mismatch in array bounds.
Reported by:	GCC -Warray-parameter
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D37544
2022-12-07 12:31:16 -08:00
John Baldwin
f322a6cef0 iwi: Fix mismatch in array bounds.
Reported by:	GCC -Warray-parameter
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D37543
2022-12-07 12:31:01 -08:00
John Baldwin
c1ebd4c98f ath: Fix mismatches in array bounds.
Reported by:	GCC -Warray-parameter
Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D37542
2022-12-07 12:30:42 -08:00
Gleb Smirnoff
3f89900bf1 udp6: fix build with INET6 and without INVARIANTS
Reported by:	Michael Butler <imb protected-networks.net>
Fixes:		483fe96511
2022-12-07 12:27:15 -08:00
Gleb Smirnoff
78ec113617 tests/netinet: mark more tests that require python 2022-12-07 11:51:49 -08:00
Gleb Smirnoff
1aed3b3430 udp: add protocol method declarations to udp_var.h
They are shared between UDP over IPv4 and over IPv6.  To prevent all
possible kernel build failures wrap them in #ifdef _SYS_PROTOSW_H_.
Prompted by feedback from jhb@ and jrtc27@ on c93db4abf4.
2022-12-07 11:51:49 -08:00
Gleb Smirnoff
5bfc014f23 udp6: inline udp6_output() into udp6_send() 2022-12-07 11:51:48 -08:00
Gleb Smirnoff
32920f038a udp: inline udp_output() into udp_send() 2022-12-07 11:51:48 -08:00
Gleb Smirnoff
483fe96511 udp: embed inpcb into udpcb
See similar change to TCP e68b379244 for more context.  For UDP the
change is much simplier, though.
2022-12-07 11:51:42 -08:00
Dimitry Andric
c24a6b32bb Remove duplicated usr/bin/opieinfo line from ObsoleteFiles.inc
MFC after:	3 days
2022-12-07 20:43:57 +01:00
Simon J. Gerraty
073ccb9d55 Allow site.*.mk to augment local.*.mk and src.*.mk
Add some extra customization points so that FreeBSD build
can be adapted to local requirements.
We use these to minimize changes to share/mk

Reviewed by:	stevek
Sponsored by:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D37617
2022-12-07 11:30:35 -08:00
Warner Losh
7014e78fb7 boot: Remove stray free()
Early versions of this code had a free, but this one doesn't need
it. Remove the forgotten free(vv); from earlier versions.

Fixes:			ed56dcfc6b
Noticed by:		Michael Butler
Sponsored by:		Netflix
2022-12-07 11:30:04 -07:00
Warner Losh
e1ff7945e1 stand/kboot: Parse the command line args
Do the standard command line parsing... With a small twist to deal with
the quirks of booting via linuxboot to the initrd from the command line
in shell.efi and other observed oddities.

Sponsored by:		Netflix
2022-12-07 11:00:54 -07:00
Warner Losh
667419d553 stand/efi: remove unused local varaibles
Remove some unused local variables. No functional change.

Sponsored by:		Netflix
2022-12-07 11:00:54 -07:00
Warner Losh
ed56dcfc6b boot: pass in args as const
Copy the arg that sets a variable to maximize the reuse of this
routine. There are places we call it from that are const char * and it
might not be safe to cast that away.

Sponsored by:		Netflix
2022-12-07 11:00:54 -07:00
Warner Losh
482380c6f8 stand/kboot: Remove unneeded include.
endian.h isn't needed for this file, so remove it.

Sponsored by:		Netflix
2022-12-07 11:00:54 -07:00
Warner Losh
299c64e316 stand/kboot: Initialize all the devices
main() of the boot loader is expected to call devinit() early. We do
this at the same time we do it in the EFI loader (except we don't have a
buffer cache here, we don't need to initialize time and we don't have
special efi partition handles to enumerate). This is just after we probe
for the console.

Sponsored by:		Netflix
2022-12-07 11:00:54 -07:00
Warner Losh
288626083b kboot: copy EFI's bootinfo.c and adjust
Copy EFI's bootinfo.c and make minor adjustments for kboot's needs. Do
not connect this to the build just yet until other pieces are in place.

Sponsored by:		Netflix
2022-12-07 11:00:54 -07:00
Warner Losh
b11aebff4d kboot: Mark the EFI specific parts of bootinfo.c
bootinfo.c is about to be shared with kboot since they create
substantially similar environments / metadata tagging / etc. Tag this
with #ifdef EFI for the moment until the proper abstracting out can
happen.

Sponsored by:		Netflix
2022-12-07 11:00:54 -07:00
Gleb Smirnoff
0c0d8a4f7e udp: rearrange declarations in udp_var.h into user and _KERNEL halves
Bring everything that belongs to _KERNEL into single block.  Move
sub-includes to its beginning.
2022-12-07 09:55:38 -08:00
Gleb Smirnoff
294a609fc0 udp: destroy UDP and UDP-Lite inpcbinfos in single SYSUNINIT
They are created in a single SYSINIT, there is no reason to destroy
them in separate functions.
2022-12-07 09:55:38 -08:00
Gleb Smirnoff
446ccdd08e tcp: use single locked callout per tcpcb for the TCP timers
Use only one callout structure per tcpcb that is responsible for handling
all five TCP timeouts.  Use locked version of callout, of course. The
callout function tcp_timer_enter() chooses soonest timer and executes it
with lock held.  Unless the timer reports that the tcpcb has been freed,
the callout is rescheduled for next soonest timer, if there is any.

With single callout per tcpcb on connection teardown we should be able
to fully stop the callout and immediately free it, avoiding use of
callout_async_drain().  There is one gotcha here: callout_stop() can
actually touch our memory when a rare race condition happens.  See
comment above tcp_timer_stop().  Synchronous stop of the callout makes
tcp_discardcb() the single entry point for tcpcb destructor, merging the
tcp_freecb() to the end of the function.

While here, also remove lots of lingering checks in the beginning of
TCP timer functions.  With a locked callout they are unnecessary.

While here, clean unused parts of timer KPI for the pluggable TCP stacks.

While here, remove TCPDEBUG from tcp_timer.c, as this allows for more
simplification of TCP timers.  The TCPDEBUG is scheduled for removal.

Move the DTrace probes in timers to the beginning of a function, where
a tcpcb is always existing.

Discussed with:		rrs, tuexen, rscheff	(the TCP part of the diff)
Reviewed by:		hselasky, kib, mav	(the callout part)
Differential revision:	https://reviews.freebsd.org/D37321
2022-12-07 09:00:48 -08:00
Gleb Smirnoff
918fa4227d tcp: remove tcp_timer_suspend()
It was a temporary code added together with RACK to fight against
TCP timer races.
2022-12-07 09:00:48 -08:00
Gleb Smirnoff
e68b379244 tcp: embed inpcb into tcpcb
For the TCP protocol inpcb storage specify allocation size that would
provide space to most of the data a TCP connection needs, embedding
into struct tcpcb several structures, that previously were allocated
separately.

The most import one is the inpcb itself.  With embedding we can provide
strong guarantee that with a valid TCP inpcb the tcpcb is always valid
and vice versa.  Also we reduce number of allocs/frees per connection.
The embedded inpcb is placed in the beginning of the struct tcpcb,
since in_pcballoc() requires that.  However, later we may want to move
it around for cache line efficiency, and this can be done with a little
effort.  The new intotcpcb() macro is ready for such move.

The congestion algorithm data, the TCP timers and osd(9) data are
also embedded into tcpcb, and temprorary struct tcpcb_mem goes away.
There was no extra allocation here, but we went through extra pointer
every time we accessed this data.

One interesting side effect is that now TCP data is allocated from
SMR-protected zone.  Potentially this allows the TCP stacks or other
TCP related modules to utilize that for their own synchronization.

Large part of the change was done with sed script:

s/tp->ccv->/tp->t_ccv./g
s/tp->ccv/\&tp->t_ccv/g
s/tp->cc_algo/tp->t_cc/g
s/tp->t_timers->tt_/tp->tt_/g
s/CCV\(ccv, osd\)/\&CCV(ccv, t_osd)/g

Dependency side effect is that code that needs to know struct tcpcb
should also know struct inpcb, that added several <netinet/in_pcb.h>.

Differential revision:	https://reviews.freebsd.org/D37127
2022-12-07 09:00:48 -08:00
Maxim Konovalov
f4a176fbaf bsd-family-tree: FreeBSD 12.4 added 2022-12-07 16:39:36 +00:00
Doug Rabson
eb6f48854d Fix a typo in the binmisc option name
This should be spelt IMGACT_BINMISC to match the filename. The option
name does not appear outside of sys/conf and this module is typically
used via the kernel module imgact_binmisc.ko.

MFC After: 2 weeks
2022-12-07 13:51:34 +00:00
Martin Matuska
bb2d13b686 zfs: merge openzfs/zfs@59493b63c (master)
Notable upstream pull request merges:
  #13782 Fix setting the large_block feature after receiving a snapshot
  #14157 FreeBSD: stop using buffer cache-only routines on sync
  #14172 zed: post a udev change event from spa_vdev_attach()
  #14181 zed: unclean disk attachment faults the vdev
  #14190 Bump checksum error counter before reporting to ZED
  #14196 Remove atomics from zh_refcount
  #14197 Don't leak packed recieved proprties
  #14198 Switch dnode stats to wmsums
  #14199 Remove few pointer dereferences in dbuf_read()
  #14200 Micro-optimize zrl_remove()
  #14204 Lua: Fix bad bitshift in lua_strx2number()
  #14212 Zstd fixes
  #14218 Avoid a null pointer dereference in zfs_mount() on FreeBSD
  #14235 nopwrites on dmu_sync-ed blocks can result in a panic
  #14236 zio can deadlock during device removal
  #14247 Micro-optimize fletcher4 calculations
  #14261 FreeBSD: zfs_register_callbacks() must implement error check
         correctly

Obtained from:	OpenZFS
OpenZFS commit:	59493b63c1
2022-12-07 14:10:46 +01:00
Gordon Bergling
899edecdbe protocols.5: Update the description of /etc/protocols
The reference to the "DARPA Internet" seems not quite
up to date in 2022, so move that to the HISTORY section.

Mention RFC 2780 and RFC 5237.

Obtained from:	NetBSD
MFC after:	3 days
2022-12-07 12:31:44 +01:00
Peter Holm
2518b1c742 stress2: Add list of problems found 2022-12-07 12:03:44 +01:00
Gordon Bergling
0393604aa8 getservent.3: Mention the service.db
- reference /var/db/services.db
- reference services_mkdb(8)

Obtained from:	NetBSD
MFC after:	3 days
2022-12-07 10:26:13 +01:00
Simon J. Gerraty
48e733eef9 Add some more local.*.mk includes
These facilitate customizing the build with minimal churn.

Reviewed by:	stevek
Sponsored by:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D37592
2022-12-06 10:49:54 -08:00
Andrew Gallatin
17859d538c ixl: silence runtime warning when PCI_IOV is not enabled
When PCI_IOV is not enabled, do not attempt to call
iflib_softirq_alloc_generic(...IFLIB_INTR_IOV), as it results
in boot-time warnings similar to:
	taskqgroup_attach_cpu: qid not found for iov cpu=2
	ixl2: taskqgroup_attach_cpu failed 22
Instead, make it conditional on PCI_IOV like the other
SR-IOV related code.

Reviewed by:	erj
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D37609
2022-12-06 11:35:18 -05:00
Emmanuel Vadot
72621b543e linuxkpi: Fix style for dma_map_sgtable
Reported by:	bz
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2022-12-06 16:52:16 +01:00
Austin Shafer
4085bde9fa linuxkpi: Fix return value of dma_map_sgtable
dma_map_sgtable internally uses the dma_map_sg_attrs helper. The problem is
that dma_map_sg_attrs returns the number of entries mapped, whereas
dma_map_sgtable returns nonzero on failure. This leads to dma_map_sgtable
returning non-zero-but-positive values which tricks other areas of the stack
into thinking nents is a valid pointer.

This checks if nents is valid and returns zero if so, updating the nents field
in sgt. This fixes PRIME render offload with nvidia-drm.

Fixes:	9202c95f47 ("linuxkpi: Add dma_{un,}map_sgtable")
2022-12-06 16:25:53 +01:00
Corvin Köhne
b972e7cbb4
bhyve: build SPCR ACPI table
OVMF ships some static ACPI tables. This worked in the past but won't
work in the future when we support devices like tpms. They require a TPM
ACPI table. So, we have to dynamically create ACPI tables depending on
the bhyve configuration.

Bhyve has much more information about the system than OVMF. Therefore,
it's easier for bhyve to build up some ACPI tables. For that reason, it
would be much better to use the ACPI tables provided by bhyve instead of
building some tables by OVMF.

At the moment, OVMF always creates a SPCR table. Maybe someone depends
on it. So, we have to build it by bhyve too before we can patch OVMF to
install the tables provided by bhyve.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D37591
2022-12-06 12:58:27 +01:00
Peter Holm
6e36cfadbc stress2: No need to run tests for 30 minutes 2022-12-06 10:32:49 +01:00
Baptiste Daroussin
d525abd277 dma(8): add newaliases to mailer.conf
Reported by:	karels
MFC After:	3 days
2022-12-06 08:31:23 +01:00