]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
22 months agoImport device-tree files from Linux 5.16
Emmanuel Vadot [Wed, 10 Aug 2022 12:27:16 +0000 (14:27 +0200)]
Import device-tree files from Linux 5.16

Sponsored by:   Beckhoff Automation GmbH & Co. KG

22 months agoImport device-tree files from Linux 5.16
Emmanuel Vadot [Wed, 10 Aug 2022 12:25:35 +0000 (14:25 +0200)]
Import device-tree files from Linux 5.16

22 months agoImport device-tree files from Linux 5.15
Emmanuel Vadot [Wed, 10 Aug 2022 12:21:52 +0000 (14:21 +0200)]
Import device-tree files from Linux 5.15

Sponsored by: Beckhoff Automation GmbH & Co. KG

22 months agoImport device-tree files from Linux 5.15
Emmanuel Vadot [Wed, 10 Aug 2022 12:20:33 +0000 (14:20 +0200)]
Import device-tree files from Linux 5.15

22 months agoImport device-tree files from Linux 5.14
Emmanuel Vadot [Wed, 10 Aug 2022 12:11:47 +0000 (14:11 +0200)]
Import device-tree files from Linux 5.14

22 months agoImport device-tree files from Linux 5.14
Emmanuel Vadot [Wed, 10 Aug 2022 12:05:33 +0000 (14:05 +0200)]
Import device-tree files from Linux 5.14

22 months agotcp: improve BBLog for output events when using the FreeBSD stack
Michael Tuexen [Mon, 8 Aug 2022 11:07:10 +0000 (13:07 +0200)]
tcp: improve BBLog for output events when using the FreeBSD stack

Put the return value of ip_output()/ip6_output in the output event
instead of adding another one in case of an error. This improves
consistency with other similar places.

Reviewed by: rscheff
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D36085

22 months agosctp: improve handling of send() calls with no user data`
Michael Tuexen [Mon, 8 Aug 2022 10:53:42 +0000 (12:53 +0200)]
sctp: improve handling of send() calls with no user data`

In particular, don't report EAGAIN on send() calls with no user
data, which might trigger a KASSERT in asyc IO.

Reported by: syzbot+3b4dc5d1d63e9bd01eda@syzkaller.appspotmail.com
MFC after: 1 week

22 months agoarc4random(3): Reduce diff with OpenBSD.
Xin LI [Wed, 10 Aug 2022 00:27:54 +0000 (17:27 -0700)]
arc4random(3): Reduce diff with OpenBSD.

The main change was v1.57 by djm@:

  Randomise the rekey interval a little. Previously, the chacha20
  instance would be rekeyed every 1.6MB. This makes it happen at a
  random point somewhere in the 1-2MB range.

Reviewed by: csprng (markm, cem)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D36088

22 months agotests: Add more shared shadow regression tests
Mark Johnston [Tue, 9 Aug 2022 20:17:56 +0000 (16:17 -0400)]
tests: Add more shared shadow regression tests

The new tests exercise simulated COW that occurs when the protections on
a wired, copy-on-write mapping are changed from read-only to read-write.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35636

22 months agoatomic: Add plain atomic_load/store_bool()
Mark Johnston [Tue, 9 Aug 2022 20:08:29 +0000 (16:08 -0400)]
atomic: Add plain atomic_load/store_bool()

Reviewed by: kib
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36078

22 months agodtrace/amd64: Implement emulation of call instructions
Mark Johnston [Tue, 9 Aug 2022 20:08:13 +0000 (16:08 -0400)]
dtrace/amd64: Implement emulation of call instructions

Here, the provider is responsible for updating the trapframe to redirect
control flow and for computing the return address.  Once software-saved
registers are restored, the emulation shifts the remaining context down
on the stack to make space for the return address, then copies the
address provided by the invop handler.  dtrace_invop() is modified to
allocate temporary storage space on the stack for use by the provider to
return the return address.

This is to support a new provider for amd64 which can instrument
arbitrary instructions, not just function entry and exit instructions as
FBT does.

In collaboration with: christos
Sponsored by: Google, Inc. (GSoC 2022)
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

22 months agofbt/x86: Extract arg1 for return probes from the trapframe
Mark Johnston [Tue, 9 Aug 2022 20:08:09 +0000 (16:08 -0400)]
fbt/x86: Extract arg1 for return probes from the trapframe

dtrace invop handlers have access to the whole trapframe, just use that
to extract %rax/%eax for return probes instead of relying on an
additional parameter to the handler.  No functional change intended.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation

22 months agorelease: Include an etcupdate tree in -DNO_ROOT release image builds
Jessica Clarke [Tue, 9 Aug 2022 21:58:01 +0000 (22:58 +0100)]
release: Include an etcupdate tree in -DNO_ROOT release image builds

This makes use of the new -N etcupdate flag and merges the resulting
METALOG into base.meta re-rooted to /var/db/etcupdate/current.

Reviewed by: gjb
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D35858

22 months agoetcupdate: Add a -N flag to perform a NO_ROOT build
Jessica Clarke [Tue, 9 Aug 2022 21:57:47 +0000 (22:57 +0100)]
etcupdate: Add a -N flag to perform a NO_ROOT build

This is in preparation for including an etcupdate tree when performing a
-DNO_ROOT release image build. Although -DNO_ROOT can be passed via -M,
to be useful we need to mangle the resulting METALOG to mirror the
various cleanups to the tree that are done after the build (removing
generated files, empty files and empty directories), so etcupdate needs
its own flag.

Reviewed by: jhb, pauamma
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D35857

22 months agoetcupdate: Prefer POSIX -depth to BSD -d
Jessica Clarke [Tue, 9 Aug 2022 21:57:22 +0000 (22:57 +0100)]
etcupdate: Prefer POSIX -depth to BSD -d

This is in preparation for building an etcupdate tree on non-FreeBSD
when building release images. The -d option is documented as a
BSD-specific equivalent to the POSIX -depth primary. Whilst GNU find
sort of accepts it in an attempt to be compatible, it still doesn't
permit it coming before the paths, unlike BSD find, and prints a
deprecation warning either way. Thus, use the equivalent POSIX -depth to
ensure it works correctly and without warning everywhere.

Reviewed by: jhb
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D35856

22 months agorelease: Forward ${MAKE} to etcupdate via the new -m flag
Jessica Clarke [Tue, 9 Aug 2022 21:57:01 +0000 (22:57 +0100)]
release: Forward ${MAKE} to etcupdate via the new -m flag

This is in preparation for non-FreeBSD builds where make is GNU make and
so etcupdate needs to know the name of or path to the bmake binary to
use for its own builds.

Reviewed by: gjb
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D35855

22 months agoetcupdate: Add a -m flag to change the make binary that's run
Jessica Clarke [Tue, 9 Aug 2022 21:56:19 +0000 (22:56 +0100)]
etcupdate: Add a -m flag to change the make binary that's run

This will allow release/Makefile to forward on ${MAKE} to allow building
on non-FreeBSD systems where ${MAKE} is something other than make, as
make is typically GNU make in such situations.

Reviewed by: jhb, pauamma
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D35854

22 months agorelease: Use in-tree etcupdate for build
Jessica Clarke [Tue, 9 Aug 2022 21:52:47 +0000 (22:52 +0100)]
release: Use in-tree etcupdate for build

This is in preparation for non-FreeBSD and -DNO_ROOT builds. On
non-FreeBSD there is no host etcupdate to use, and -DNO_ROOT will
require additional flags that may not be supported by the host's
etcupdate when building on FreeBSD. Moreover, there's no guarantee
anyway that the host's etcupdate is quite right for the current tree;
upgrading from source only requires that the host's is good enough for
-p which just manually copies master.passwd and group, the rest of the
upgrade is done post-installworld. For example, should a new set of
autogenerated files be added that etcupdate is taught about, the host
won't know about them and so the bootstrapped current tree will
incorrectly contain them, leading to spurious diffs on the installed
system.

Reviewed by: gjb, delphij
Obtained from: CheriBSD
Differential Revision: https://reviews.freebsd.org/D35853

22 months agovm_fault: Shoot down shared mappings in vm_fault_copy_entry()
Mark Johnston [Mon, 25 Jul 2022 20:53:21 +0000 (16:53 -0400)]
vm_fault: Shoot down shared mappings in vm_fault_copy_entry()

As in vm_fault_cow(), it's possible, albeit rare, for multiple vm_maps
to share a shadow object.  When copying a page from a backing object
into the shadow, all mappings of the source page must therefore be
removed.  Otherwise, future operations on the object tree may detect
that the source page is fully shadowed and thus can be freed.

Approved by: so
Security: FreeBSD-SA-22:11.vm
Reviewed by: alc, kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35635

22 months agoelf_note_prpsinfo: handle more failures from proc_getargv()
Konstantin Belousov [Fri, 3 Jun 2022 08:21:23 +0000 (11:21 +0300)]
elf_note_prpsinfo: handle more failures from proc_getargv()

Resulting sbuf_len() from proc_getargv() might return 0 if user mangled
ps_strings enough. Also, sbuf_len() API contract is to return -1 if the
buffer overflowed. The later should not occur because get_ps_strings()
checks for catenated length, but check for this subtle detail explicitly
as well to be more resilent.

The end result is that p_comm is used in this situations.

Approved by: so
Security: FreeBSD-SA-22:09.elf
Reported by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Reviewed by: delphij, markj
admbugs: 988
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D35391

22 months agorelease: ensure enforce_chs sysctl is 0
Ed Maste [Tue, 19 Jul 2022 20:47:49 +0000 (16:47 -0400)]
release: ensure enforce_chs sysctl is 0

We do not want CHS-based alignment for VM or SD card release images.

(Other images use makefs/mkimg, not kernel gpart and so do not depend
on this sysctl.)

Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)
MFC after: 1 week

22 months agoAdd "heard" to the dictionary
Ed Maste [Mon, 8 Aug 2022 18:57:32 +0000 (14:57 -0400)]
Add "heard" to the dictionary

PR: 265671
Reported by: J.R. Oldroyd
MFC after: 3 days

22 months agoAdd the PHY driver for the Marvell 88E1512.
Luiz Souza [Fri, 29 Jul 2022 15:43:56 +0000 (17:43 +0200)]
Add the PHY driver for the Marvell 88E1512.

This driver supports the auto negotiation mode between the copper and fiber
ports.

This PHY has two independent PHYs (one for copper and other for fiber) but in
this case the functionality is presented as a single PHY for easy management.

Sponsored by: Rubicon Communications, LLC ("Netgate")

22 months agoif_ovpn tests: remote access test case
Kristof Provost [Thu, 28 Jul 2022 09:55:53 +0000 (11:55 +0200)]
if_ovpn tests: remote access test case

Add a (multi-client) test case where we route traffic beyond the ovpn
server, onto a shared LAN.

Sponsored by: Rubicon Communications, LLC ("Netgate")

22 months agonetinet tests: Add test for IPv6 mapped-v4 bind problem
Mike Karels [Tue, 9 Aug 2022 12:08:09 +0000 (07:08 -0500)]
netinet tests: Add test for IPv6 mapped-v4 bind problem

Test fix in 637f317c6d9c, verifying that when ports run out, we get
an EADDRNOTAVAIL error from bind() rather than an EADDRINUSE error
from connect().  Use small port range to exhaust ports and see which
error happens.

Reviewed by: tuexen, glebius, melifaro
Differential Revision: https://reviews.freebsd.org/D36056
MFC after: 3 days (with 637f317c6d9c)

22 months agolibpathconv: bump man page dates
Gordon Bergling [Tue, 9 Aug 2022 08:05:31 +0000 (10:05 +0200)]
libpathconv: bump man page dates

- bump the man page dates to the date of mandoc fixes

Reported by: rpokala
X-MFC with: 094517119c62c23369d545a7475ae982d86330a3

22 months agox86: Remove redundant parentheses
Emmanuel Vadot [Tue, 9 Aug 2022 07:46:50 +0000 (09:46 +0200)]
x86: Remove redundant parentheses

Reported by: avg
Sponsored by: Beckhoff Automation GmbH & Co. KG
MFC after: 1 week
MFC-With: b223c1f1a0ac ("x86: Add another cpuid for Apollo Lake errata APL30")

22 months agox86: Add another cpuid for Apollo Lake errata APL30
Corvin Köhne [Tue, 9 Aug 2022 07:07:59 +0000 (09:07 +0200)]
x86: Add another cpuid for Apollo Lake errata APL30

Sponsored by: Beckhoff Automation GmbH & Co. KG
MFC after: 1 week

22 months agosyslog(3): unbreak log generation using fabricated PID
Eugene Grosbein [Mon, 8 Aug 2022 22:21:02 +0000 (05:21 +0700)]
syslog(3): unbreak log generation using fabricated PID

Recover application ability to supply fabricated PID
embedded into ident that was lost when libc switched
to generation of RFC 5424 log messages, for example:

logger -t "ident[$$]" -p user.notice "test"

It is essential for long running scripts.
Also, this change unbreaks matching resulted entries
by ident in syslog.conf:

!ident
*.* /var/log/ident.log

Without the fix, the log (and matching) was broken:

Aug  1 07:36:58 hostname ident[123][86483]: test

Now it works as expected and worked before breakage:

Aug  1 07:39:40 hostname ident[123]: test

Differential: https://reviews.freebsd.org/D36005
MFC after: 2 weeks

22 months agotests/socket: add accept_filter(9) test
Gleb Smirnoff [Mon, 8 Aug 2022 21:10:18 +0000 (14:10 -0700)]
tests/socket: add accept_filter(9) test

Test basic functionality of accf_data(9) and accf_http(9)

22 months agoapply: clean up error handling.
Dag-Erling Smørgrav [Mon, 8 Aug 2022 19:06:35 +0000 (19:06 +0000)]
apply: clean up error handling.

Sponsored by: Klara, Inc.

22 months agolinuxkpi: io.h: Only exclude armv6 and armv7 for asm/set_memory.h
Emmanuel Vadot [Mon, 8 Aug 2022 18:21:08 +0000 (20:21 +0200)]
linuxkpi: io.h: Only exclude armv6 and armv7 for asm/set_memory.h

Other arches like powerpc* needs it.

Fixes: d387a1b4b1996 ("linuxkpi: io.h: Do not include asm/set_memory.h for armv6 and armv7")
Fixes: 789dbdbb48574 ("linuxkpi: Add arch_io_{reserve,free}_memtype_wc")
Sponsored by: Beckhoff Automation GmbH & Co. KG

22 months agoktls_test: Add a require_toe option similar to require_ifnet.
John Baldwin [Mon, 8 Aug 2022 18:21:54 +0000 (11:21 -0700)]
ktls_test: Add a require_toe option similar to require_ifnet.

This skips tests that send and receive records that do not use TOE TLS.

Sponsored by: Chelsio Communications

22 months agocxgbe TOE TLS: Fix handling of unusual record types.
John Baldwin [Mon, 8 Aug 2022 18:21:54 +0000 (11:21 -0700)]
cxgbe TOE TLS: Fix handling of unusual record types.

This doesn't matter for real traffic but fixes failures in the KTLS
unit tests that use unusual record types.

Sponsored by: Chelsio Communications

22 months agocxgbe TOE TLS: Simplify a few routines.
John Baldwin [Mon, 8 Aug 2022 18:21:54 +0000 (11:21 -0700)]
cxgbe TOE TLS: Simplify a few routines.

Remove a few more remnants from the old pre-KTLS support and instead
assume that each work request sends a single TLS record.

Sponsored by: Chelsio Communications

22 months agocxgbe: Handle requests for TLS key allocations with no TLS key storage.
John Baldwin [Mon, 8 Aug 2022 18:21:54 +0000 (11:21 -0700)]
cxgbe: Handle requests for TLS key allocations with no TLS key storage.

If an adapter advertises support for TLS keys but an empty TLS key
storage area in on-board memory, fail the request rather than invoking
vmem_alloc on an uninitialized vmem.

Sponsored by: Chelsio Communications

22 months agocxgbe: Rename t4_kern_tls.c to t6_kern_tls.c.
John Baldwin [Mon, 8 Aug 2022 18:21:53 +0000 (11:21 -0700)]
cxgbe: Rename t4_kern_tls.c to t6_kern_tls.c.

This implementation of NIC TLS is specific to T6 adapters.

Sponsored by: Chelsio Communications

22 months agozlib: Fix extra field processing bug that dereferences NULL state->head.
Mark Adler [Mon, 8 Aug 2022 17:50:09 +0000 (10:50 -0700)]
zlib: Fix extra field processing bug that dereferences NULL state->head.

The recent commit to fix a gzip header extra field processing bug
introduced the new bug fixed here.

(cherry picked from zlib commit 1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d)

22 months agolinuxkpi: io.h: Do not include asm/set_memory.h for armv6 and armv7
Emmanuel Vadot [Mon, 8 Aug 2022 16:54:23 +0000 (18:54 +0200)]
linuxkpi: io.h: Do not include asm/set_memory.h for armv6 and armv7

They do not have the same pmap api and this cannot work for those arch.

Fixes: 789dbdbb48574 ("linuxkpi: Add arch_io_{reserve,free}_memtype_wc")
Sponsored by: Beckhoff Automation GmbH & Co. KG

22 months agoMerge libcxxrt commit 5d8a15823a103bbc27f1bfdcf2b5aa008fab57dd
Mark Johnston [Mon, 8 Aug 2022 16:30:56 +0000 (12:30 -0400)]
Merge libcxxrt commit 5d8a15823a103bbc27f1bfdcf2b5aa008fab57dd

  Fix two bugs in __cxa_end_cleanup()

  Per the EHABI32 specification, __cxa_end_cleanup must take care to
  preserve registers before calling _Unwind_Resume().  So, libcxxrt uses
  an assembly stub which preserves caller-saved registers around the call
  to __cxa_get_cleanup().  But:
  - it failed to restore them properly,
  - it did not preserve the link register.

  Fix both of these problems.  This is needed to fix exception unwinding
  on FreeBSD with LLVM 14.  Note that r4 is callee-saved but is pushed
  onto the stack to preserve stack pointer alignment.

Sponsored-by: The FreeBSD Foundation
MFC after: 1 week

22 months agolib9p: Remove potential buffer overwrite in l9p_puqids()
Konrad Sewiłło-Jopek [Mon, 8 Aug 2022 16:25:48 +0000 (12:25 -0400)]
lib9p: Remove potential buffer overwrite in l9p_puqids()

Structure l9p_f_wralk reserves at most L9P_MAX_WELEM entries
and that number actually set the maximum we can safely use.

PR: 265385
Reviewed by: markj
MFC after: 1 day
Differential Revision: https://reviews.freebsd.org/D35907

22 months agothread_create(): call cpu_copy_thread() after td_pflags is zeroed
Konstantin Belousov [Sun, 7 Aug 2022 17:00:02 +0000 (20:00 +0300)]
thread_create(): call cpu_copy_thread() after td_pflags is zeroed

By calling the function too early we might still have the td_pflags
value cached from the previous struct thread use. cpu_copy_thread()
depends on correct value for TDP_KTHREAD at least on x86.

Reported, bisected, and tested by: pho
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D36069

22 months agopf: stop resolving hosts as dns that use ":" modifier
Franco Fichtner [Mon, 8 Aug 2022 16:31:02 +0000 (18:31 +0200)]
pf: stop resolving hosts as dns that use ":" modifier

When the interface does not exist avoid passing host with special pf
modifiers to DNS resolution as they come up empty anyway.

Reviewed by: kp
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D35429

22 months agorelease: fix alignment for arm SoCs
Glen Barber [Mon, 8 Aug 2022 14:59:29 +0000 (10:59 -0400)]
release: fix alignment for arm SoCs

MFC after: 3 days
Submitted by: Mark Millard
Sponsored by: Rubicon Communications, LLC ("Netgate")

22 months agoBump __FreeBSD_version after linuxkpi changes.
Emmanuel Vadot [Mon, 8 Aug 2022 13:22:11 +0000 (15:22 +0200)]
Bump __FreeBSD_version after linuxkpi changes.

22 months agolinuxkpi: pm: Add more defines and includes
Emmanuel Vadot [Tue, 2 Aug 2022 08:49:13 +0000 (10:49 +0200)]
linuxkpi: pm: Add more defines and includes

Needed by drm-kmod.

Reviewed By: emaste, hselasky
Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36024

22 months agolinuxkpi: Include highmem.h in pagemap.h
Emmanuel Vadot [Tue, 2 Aug 2022 08:42:46 +0000 (10:42 +0200)]
linuxkpi: Include highmem.h in pagemap.h

Linux does the same.

Reviewed by: bz, emaste, hselasky
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36023

22 months agolinuxkpi: Add arch_io_{reserve,free}_memtype_wc
Emmanuel Vadot [Tue, 2 Aug 2022 08:27:00 +0000 (10:27 +0200)]
linuxkpi: Add arch_io_{reserve,free}_memtype_wc

Reviewed by: hselasky
Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36022

22 months agolinuxkpi: Add dev_info_once
Emmanuel Vadot [Tue, 2 Aug 2022 08:22:59 +0000 (10:22 +0200)]
linuxkpi: Add dev_info_once

Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36021

22 months agolinuxkpi: Add smp_mb__before/after_atomic
Emmanuel Vadot [Tue, 2 Aug 2022 08:08:33 +0000 (10:08 +0200)]
linuxkpi: Add smp_mb__before/after_atomic

Reviewed by: hselasky
Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36020

22 months agolinuxkpi: Add trylock_page and unlock_page
Emmanuel Vadot [Tue, 2 Aug 2022 07:33:47 +0000 (09:33 +0200)]
linuxkpi: Add trylock_page and unlock_page

Simple wrapper around vm_page_trylock and vm_page_unlock.

Reviewed by: hselasky
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36019

22 months agolinuxkpi: Add more notifier defines
Emmanuel Vadot [Wed, 27 Jul 2022 07:55:06 +0000 (09:55 +0200)]
linuxkpi: Add more notifier defines

Needded by drm-kmod.

Reviewed by: bz, emaste, hselasky
Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36018

22 months agolinuxkpi: errno: Add EHWPOISON
Emmanuel Vadot [Wed, 27 Jul 2022 07:50:25 +0000 (09:50 +0200)]
linuxkpi: errno: Add EHWPOISON

Needed by drm-kmod.

Reviewed by: bz, hselasky
Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36017

22 months agolinuxkpi: Add compat_ptr and ptr_to_compat
Emmanuel Vadot [Wed, 27 Jul 2022 07:48:32 +0000 (09:48 +0200)]
linuxkpi: Add compat_ptr and ptr_to_compat

Needed by drm-kmod.

Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36016

22 months agolinuxkpi: Add try_cmpxchg and atomic_try_cmpxchg
Emmanuel Vadot [Wed, 27 Jul 2022 07:41:04 +0000 (09:41 +0200)]
linuxkpi: Add try_cmpxchg and atomic_try_cmpxchg

Needed by drm-kmod

Obtain from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D36015

22 months agolinuxkpi: Add some memset functions
Emmanuel Vadot [Tue, 26 Jul 2022 09:28:11 +0000 (11:28 +0200)]
linuxkpi: Add some memset functions

Needed by drm-kmod

Obtained from: OpenBSD
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D35943

22 months agolinuxkpi: Add io.h
Emmanuel Vadot [Tue, 26 Jul 2022 08:15:45 +0000 (10:15 +0200)]
linuxkpi: Add io.h

out* arguments are different on Linux and the i915 driver uses them.

Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D35942

22 months agolinuxkpi: Add pagevec implementation
Emmanuel Vadot [Tue, 26 Jul 2022 08:15:12 +0000 (10:15 +0200)]
linuxkpi: Add pagevec implementation

Needed by drm-kmod.

Reviewed by: hselasky
Obtained from: OpenBSD
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D35941

22 months agolinuxkpi: Add linux/nospec.h
Emmanuel Vadot [Tue, 26 Jul 2022 08:13:49 +0000 (10:13 +0200)]
linuxkpi: Add linux/nospec.h

Needed by drm-kmod.

Reviewed by: hselasky
Obtained from: OpenBSD
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D35940

22 months agolinuxkpi: Add mapping_clear_unevictable stub
Emmanuel Vadot [Tue, 26 Jul 2022 08:13:16 +0000 (10:13 +0200)]
linuxkpi: Add mapping_clear_unevictable stub

Reviewed by: hselasky
Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D35939

22 months agolinuxkpi: pci: Add more functions needed by drm
Emmanuel Vadot [Tue, 26 Jul 2022 08:07:39 +0000 (10:07 +0200)]
linuxkpi: pci: Add more functions needed by drm

Mostly stubs to satisfy building

Reviewed by: hselasky
Obtained from: drm-kmod
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D35938

22 months agolinuxkpi: math.h: Add mul_u64_u32_div and mul_u64_u32_shr
Emmanuel Vadot [Tue, 26 Jul 2022 08:06:56 +0000 (10:06 +0200)]
linuxkpi: math.h: Add mul_u64_u32_div and mul_u64_u32_shr

Needed by drm-kmod.

Reviewed by: hselasky
Obtained from: OpenBSD
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D35937

22 months agolinuxkpi: atomic: Add atomic_fetch_inc
Emmanuel Vadot [Tue, 26 Jul 2022 08:00:42 +0000 (10:00 +0200)]
linuxkpi: atomic: Add atomic_fetch_inc

Reviewed by: hselasky
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D35936

22 months agopfctl tests: test case for the POM_STICKYADDRESS fix
Kristof Provost [Mon, 8 Aug 2022 07:30:42 +0000 (09:30 +0200)]
pfctl tests: test case for the POM_STICKYADDRESS fix

In 1e73fbd8b we fixed an issue with POM_STICKYADDRESS being checked in
the wrong struct.
Add a basic test case for this fix.

MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")

22 months agoAdd drive strength setting for RK3568 pinctrl driver.
Ganbold Tsagaankhuu [Mon, 8 Aug 2022 04:42:22 +0000 (04:42 +0000)]
Add drive strength setting for RK3568 pinctrl driver.
Partially from https://reviews.freebsd.org/D36027

Submitted by: sos

22 months agortw88: correct a typo in man page
Andres Ramirez [Sun, 7 Aug 2022 23:06:28 +0000 (23:06 +0000)]
rtw88: correct a typo in man page

s/mmeory/memory/

MFC after: 1 week

22 months agoXHCI: remove a self-assignment
Bjoern A. Zeeb [Sun, 7 Aug 2022 22:46:55 +0000 (22:46 +0000)]
XHCI: remove a self-assignment

x = x is an unneeded operation, remove it.
The value is read and assigned above for real.

MFC after: 4 weeks

22 months agotests: add routing tests for switching between same prefixes
Alexander V. Chernikov [Sat, 6 Aug 2022 10:36:12 +0000 (10:36 +0000)]
tests: add routing tests for switching between same prefixes

Differential Revision: https://reviews.freebsd.org/D36055
MFC after: 2 weeks

22 months agotree.3: explain RB_FIND() and RB_NFIND()
Konstantin Belousov [Mon, 1 Aug 2022 09:43:10 +0000 (12:43 +0300)]
tree.3: explain RB_FIND() and RB_NFIND()

In collaboration with: dougm
Reviewed by: alc
Sponsored by: The FreeBSD Foundation (kib)
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D36001

22 months agotree.3: fix markup
Konstantin Belousov [Tue, 2 Aug 2022 22:26:12 +0000 (01:26 +0300)]
tree.3: fix markup

Reviewed by: alc, dougm
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Differential revision: https://reviews.freebsd.org/D36001

22 months agotcp_input: update comment to match reality.
Gleb Smirnoff [Sun, 7 Aug 2022 18:18:30 +0000 (11:18 -0700)]
tcp_input: update comment to match reality.

22 months agomfiutil.8: Fix some mandoc warnings
Gordon Bergling [Sun, 7 Aug 2022 15:24:48 +0000 (17:24 +0200)]
mfiutil.8: Fix some mandoc warnings

- new sentence, new line
- no blank before trailing delimiter

MFC after: 3 days

22 months agolibutil: Fix mandoc warnings
Gordon Bergling [Sun, 7 Aug 2022 14:30:24 +0000 (16:30 +0200)]
libutil: Fix mandoc warnings

- missing comma before name
- possible typo in section name: Sh CAVEAT instead of CAVEATS
- useless macro: Tn
- blank line in fill mode, using .sp
- no blank before trailing delimiter: Dv NULL?

MFC after: 3 days

22 months agovnode(9): Fix a typo in a source code comment
Gordon Bergling [Sun, 7 Aug 2022 14:08:43 +0000 (16:08 +0200)]
vnode(9): Fix a typo in a source code comment

- s/paramater/parameter/

MFC after: 3 days

22 months agodebugnet: Fix a typo in a source code comment
Gordon Bergling [Sun, 7 Aug 2022 14:07:01 +0000 (16:07 +0200)]
debugnet: Fix a typo in a source code comment

- s/paramaters/parameters/

MFC after: 3 days

22 months agoisci(4): Fix a typo in a source code comment
Gordon Bergling [Sun, 7 Aug 2022 14:05:08 +0000 (16:05 +0200)]
isci(4): Fix a typo in a source code comment

- s/paramater/parameter/

MFC after: 3 days

22 months agonet80211(4): Fix a typo in a source code comment
Gordon Bergling [Sun, 7 Aug 2022 14:00:07 +0000 (16:00 +0200)]
net80211(4): Fix a typo in a source code comment

- s/paramaters/parameters/

MFC after: 3 days

22 months agobsd-family-tree: fix a typo for NetBSD 9.3 release date
Sergey A. Osokin [Sun, 7 Aug 2022 13:57:14 +0000 (09:57 -0400)]
bsd-family-tree: fix a typo for NetBSD 9.3 release date

Reported by: Adrian Steinmann <ast@NetBSD.org>
Fixes: a3d933cc4f2300b476151c2dd3fa455882f3aa97
MFC after: 3 days

22 months agoacpi(4): Fix two typos in a source code comments
Gordon Bergling [Sun, 7 Aug 2022 13:58:04 +0000 (15:58 +0200)]
acpi(4): Fix two typos in a source code comments

- s/paramater/parameter/

MFC after: 3 days

22 months agolibpathconv: Fix mandoc warnings in abs2rel(3) and rel2abs(3)
Gordon Bergling [Sun, 7 Aug 2022 12:53:53 +0000 (14:53 +0200)]
libpathconv: Fix mandoc warnings in abs2rel(3) and rel2abs(3)

- cannot parse date, using it verbatim: Dec 15, 1997"
- sections out of conventional order: Sh SEE ALSO
- possible typo in section name: Sh EXAMPLE instead of EXAMPLES
- AUTHORS section without An macro

MFC after: 3 days

22 months agoinet6(4): Fix a typo in a source code comment
Gordon Bergling [Sun, 7 Aug 2022 12:20:52 +0000 (14:20 +0200)]
inet6(4): Fix a typo in a source code comment

- s/Unreachablity/Unreachability/

MFC after: 3 days

22 months agonullfs(5): Fix a typo in a source code comment
Gordon Bergling [Sun, 7 Aug 2022 12:04:53 +0000 (14:04 +0200)]
nullfs(5): Fix a typo in a source code comment

- s/examing/examining/

MFC after: 3 days

22 months agostress2: Added another fsck_ffs test scenario
Peter Holm [Sun, 7 Aug 2022 08:37:17 +0000 (10:37 +0200)]
stress2: Added another fsck_ffs test scenario

22 months agostress2: Do not run a fuzz test as root.
Peter Holm [Sun, 7 Aug 2022 08:35:47 +0000 (10:35 +0200)]
stress2: Do not run a fuzz test as root.

22 months agobsd-family-tree: add NetBSD 9.3
Sergey A. Osokin [Sat, 6 Aug 2022 19:02:42 +0000 (15:02 -0400)]
bsd-family-tree: add NetBSD 9.3

Add NetBSD 9.3, it's been released two days ago.

MFC after: 3 days

22 months agobsd-family-tree: OpenBSD 7.1 and DragonFly BSD 6.2.2
Sergey A. Osokin [Sat, 6 Aug 2022 18:56:22 +0000 (14:56 -0400)]
bsd-family-tree: OpenBSD 7.1 and DragonFly BSD 6.2.2

Add two releases to the tree.

MFC after: 3 days

22 months agoiommu_gas: avoid pointless augmentation
Doug Moore [Sat, 6 Aug 2022 18:26:18 +0000 (13:26 -0500)]
iommu_gas: avoid pointless augmentation

iommu_gas_augment_entry updates a map entry element. Invoked as
RB_AUGMENT in RB tree code, it is applied from the point where the
tree is modified, all the way up to the root, and is also applied when
rotation moves a node down in the tree.

There are several opportunities to invoke it less. The automatic
augmentation with every rotation is a mistake.  Delaying these
augmentations until RB_INSERT_COLOR or RB_REMOVE_COLOR are finishing
allows the augmentation code to be duplicated less, to work when there
is less register pressure, and to be skipped when conditions allow it:

    In the double-rotate case of RB_INSERT_COLOR, augmentation after
    the first rotation is not necessary when the element being moved
    down the tree becomes a leaf. It was in the tree, and was a leaf,
    before the RB_INSERT operation began, and so recomputing
    augmentation for it would do nothing.

    In the final (possibly only) rotation of RB_REMOVE_COLOR, both the
    elements - the one moving up and the one moving down - end up in
    the path from the deletion point to the tree root, so there's no
    need to augment either of them immediately.

    In RB_REMOVE, when the right child of the removed node replaces it
    in tree, it began with a null left child. Replacement creates a
    non-NULL left child, and then rotation may put a NULL node back in
    that place. If that happens, start the augmenting-up-to-root with
    the parent of that node, since augmentation would do nothing.

Adjust to avoid these needless augmentations.

Reviewed by: alc
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D35502

22 months agox86/iommu: Reduce the number of queued invalidation interrupts
Alan Cox [Sun, 31 Jul 2022 19:28:30 +0000 (14:28 -0500)]
x86/iommu: Reduce the number of queued invalidation interrupts

Restructure dmar_qi_task() so as to reduce the number of invalidation
completion interrupts.  Specifically, because processing completed
invalidations in dmar_qi_task() can take quite some time, don't reenable
completion interrupts until processing has completed a first time. Then,
check a second time after reenabling completion interrupts, so that
any invalidations that complete just before interrupts are reenabled
do not linger until a future invalidation might raise an interrupt.
(Recent changes have made checking for completed invalidations cheap; no
locking is required.)

Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D36054

22 months agopowerpc/booke: Clamp MAXCPU to 32 for Book-E platforms
Justin Hibbits [Sat, 6 Aug 2022 15:35:44 +0000 (11:35 -0400)]
powerpc/booke: Clamp MAXCPU to 32 for Book-E platforms

Since the likelihood of new Book-E PowerPC SoCs being produced is near
zero clamp MAXCPU to around the highest number of cores/threads
available currently, for both 64-bit and 32-bit.  Even though the
current highest core/thread count is 24, the cap is set at 32 in case
there is code that assumes power of 2.

22 months agopfctl: fix FOM_ICMP/POM_STICKYADDRESS clash
Franco Fichtner [Sat, 6 Aug 2022 08:59:56 +0000 (10:59 +0200)]
pfctl: fix FOM_ICMP/POM_STICKYADDRESS clash

pass inet proto icmp icmp-type {unreach}
pass route-to (if0 127.0.0.1/8) sticky-address inet

The wrong struct was being tested. The parser tries to prevent
"sticky-address sticky-address" syntax but was actually cross-rule
enforcing that ICMP filter cannot be before the use of "sticky-address"
in next rule.

MFC after: 2 weeks
Reviewed by: kp
Differential Revision: https://reviews.freebsd.org/D36050

22 months agofib_algo: set vnet when destroying algo instance
Alexander V. Chernikov [Sat, 6 Aug 2022 12:44:44 +0000 (12:44 +0000)]
fib_algo: set vnet when destroying algo instance

Reported by: Konrad Kręciwilk <konrad.kreciwilk@korbank.pl>
MFC after: 2 weeks

22 months agobce(4): Fix two typos in kernel messages
Gordon Bergling [Sat, 6 Aug 2022 09:32:29 +0000 (11:32 +0200)]
bce(4): Fix two typos in kernel messages

- s/bufferred/buffered/

MFC after: 3 days

22 months agounbound: Update version to 1.16.2
Cy Schubert [Sat, 6 Aug 2022 08:59:22 +0000 (01:59 -0700)]
unbound: Update version to 1.16.2

Chase 790c6b245151 to update the version to 1.16.2.

Reported by: "Herbert J. Skuhra" <herbert@gojira.at>
MFC after: 3 days
X-MFC with: 790c6b245151

22 months agonet80211: Remove tautological state display
Cy Schubert [Tue, 19 Jul 2022 04:10:40 +0000 (21:10 -0700)]
net80211: Remove tautological state display

When printing the current state name and the old state numeric value,
both are always the same. Remove the redundant ostate. It is always
the same as iv_state.

Reviewed by: bz
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D35849

22 months agounbound: Vendor import 1.16.2
Cy Schubert [Sat, 6 Aug 2022 01:44:40 +0000 (18:44 -0700)]
unbound: Vendor import 1.16.2

Security update to unbound.

PR:             265645
Security:       CVE-2022-30698, CVE-2022-30699
Security:       bc43a578-14ec-11ed-856e-d4c9ef517024
MFC after:      3 days

Merge commit '9b76d32f2310b735dbeb896cbf2776cad61f23e8' into main

22 months agobpf: Fix BIOCPROMISC locking
Mark Johnston [Fri, 5 Aug 2022 20:25:05 +0000 (16:25 -0400)]
bpf: Fix BIOCPROMISC locking

BPF might put an interface in promiscuous mode when handling the
BIOCSDLT ioctl.  When this happens, a flag is set in the BPF descriptor
so that the old interface can be restored when the BPF descriptor is
destroyed.

The BIOCPROMISC ioctl can also be used to put a BPF descriptor's
interface into promiscuous mode, but there was nothing synchronizing the
flag.  Fix this by modifying the ioctl handler to acquire the global BPF
mutex, which is used to synchronize ifpromisc() calls elsewhere in BPF.

Reviewed by: kp, melifaro
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36045

22 months agoarm: Clear TTBCR before enabling the MMU
Mark Johnston [Fri, 5 Aug 2022 20:21:09 +0000 (16:21 -0400)]
arm: Clear TTBCR before enabling the MMU

Upon reset, this register is supposed to have a value of zero.  But when
booting certain v7 CPUs in QEMU, we enter the kernel with several bits
set, including the EAE bit, which enables ARM's PAE extension.  I'm not
sure if QEMU is setting it or if it's the uboot loader.  Because FreeBSD
doesn't implement that extension and uses regular 32-bit page tables,
the kernel hangs immediately after enabling the MMU.

Just clear everything in TTBCR before enabling the MMU, to match the
reset value.  FreeBSD doesn't toggle anything in that register.

PR: 251187
Reviewed by: imp
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36041

22 months agounbound: Vendor import 1.16.2
Cy Schubert [Fri, 5 Aug 2022 20:02:55 +0000 (13:02 -0700)]
unbound: Vendor import 1.16.2

Security update to unbound.

PR: 265645
Security: CVE-2022-30698, CVE-2022-30699
Security: bc43a578-14ec-11ed-856e-d4c9ef517024

22 months agoacpi_apei: Add sysctl to mute corrected errors.
Alexander Motin [Fri, 5 Aug 2022 17:45:35 +0000 (13:45 -0400)]
acpi_apei: Add sysctl to mute corrected errors.

Setting hw.acpi.apei.log_corrected to 0 will mute corrected errors logging.

MFC after: 1 week