]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
14 months agodtrace/powerpc: Adjust AFRAMES for fbt and profile
Justin Hibbits [Sat, 11 Mar 2023 16:23:38 +0000 (11:23 -0500)]
dtrace/powerpc: Adjust AFRAMES for fbt and profile

FBT_AFRAMES was skipping over too many frames, while PROFILE_AFRAMES was
skipping over too few.  Adjust them empirically.

14 months agophyp_llan: Mechanically convert to IfAPI
Justin Hibbits [Sat, 11 Mar 2023 16:25:25 +0000 (11:25 -0500)]
phyp_llan: Mechanically convert to IfAPI

Sponsored by: Juniper Networks, Inc.

14 months agodtsec: Complete mechanical conversion to IfAPI
Justin Hibbits [Tue, 7 Mar 2023 20:41:38 +0000 (15:41 -0500)]
dtsec: Complete mechanical conversion to IfAPI

Some changes were missed in 0083fc5c76.

Sponsored by: Juniper Networks, Inc.

14 months agorc.conf.5: fix typo of route6d that I introduced while nitpicking
Ceri Davies [Sat, 11 Mar 2023 14:56:40 +0000 (14:56 +0000)]
rc.conf.5: fix typo of route6d that I introduced while nitpicking

14 months agorc.conf.5: dhclient came from OpenBSD, but now isn't the OpenBSD client
Ceri Davies [Sat, 11 Mar 2023 14:54:11 +0000 (14:54 +0000)]
rc.conf.5: dhclient came from OpenBSD, but now isn't the OpenBSD client

14 months agovm: read-locked fault handling for backing objects
Mateusz Guzik [Tue, 7 Mar 2023 20:56:54 +0000 (20:56 +0000)]
vm: read-locked fault handling for backing objects

This is almost the simplest patch which manages to avoid write locking
for backing objects, as a result mostly fixing vm object contention
problems.

What is not fixed:
1. cacheline ping pong due to read-locks
2. cacheline ping pong due to pip
3. cacheling ping pong due to object busying
4. write locking on first object

On top of it the use of VM_OBJECT_UNLOCK instead of explicitly tracking
the state is slower multithreaded that it needs to be, done for
simplicity for the time being.

Sample lock profiling results doing -j 104 buildkernel on tmpfs:
before:
71446200 (rw:vmobject)
14689706 (sx:vm map (user))
4166251 (rw:pmap pv list)
2799924 (spin mutex:turnstile chain)

after:
19940411 (rw:vmobject)
8166012 (rw:pmap pv list)
6017608 (sx:vm map (user))
1151416 (sleep mutex:pipe mutex)

Reviewed by: kib
Reviewed by: markj
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D38964

14 months agovm: add VM_OBJECT_UNLOCK
Mateusz Guzik [Tue, 7 Mar 2023 20:47:44 +0000 (20:47 +0000)]
vm: add VM_OBJECT_UNLOCK

Reviewed by: kib
Reviewed by: markj
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D38964

14 months agovm: move up object lock asserts in fault functions
Mateusz Guzik [Sun, 7 Aug 2022 13:05:47 +0000 (13:05 +0000)]
vm: move up object lock asserts in fault functions

No functional changes.

Reviewed by: kib
Reviewed by: markj
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D38964

14 months agoqat: Reconnect qat.4 to the build
Mark Johnston [Fri, 10 Mar 2023 23:30:08 +0000 (18:30 -0500)]
qat: Reconnect qat.4 to the build

It was disconnected when the new QAT driver was imported, and never
reconnected.

14 months agonetbsd-tests: Serialize message queue tests
Mark Johnston [Fri, 10 Mar 2023 22:07:06 +0000 (17:07 -0500)]
netbsd-tests: Serialize message queue tests

They can fail when run in parallel since they all share a global queue
key.

MFC after: 1 week

14 months agonetbsd-tests: Remove some pointless sleeps from message queue tests
Mark Johnston [Fri, 10 Mar 2023 22:06:46 +0000 (17:06 -0500)]
netbsd-tests: Remove some pointless sleeps from message queue tests

- In the msgctl tests, there is no point in sleeping after a fork().
  Just block immediately in wait().
- In non-blocking send/recv tests, just wait for the child to exit once
  it's reached a message limit.  If a bug prevents the child from
  exiting promptly, the test will time out.

MFC after: 1 week

14 months agoopts: fix silly typo
Warner Losh [Fri, 10 Mar 2023 16:00:38 +0000 (09:00 -0700)]
opts: fix silly typo

It's powerpcspe not powerpcspc

Pointy Hat To: imp
Noticed by: jhibbits
Fixes: 41cf798e8206
Sponsored by: Netflix

14 months agoopts: popwerpcspc is also 32-bit
Warner Losh [Fri, 10 Mar 2023 15:45:05 +0000 (08:45 -0700)]
opts: popwerpcspc is also 32-bit

Mark ZFS broken here too, add comment about why.  Add comments about
OFED being disabled on 32-bit arm, add comment about why too.

Sponsored by: Netflix

14 months agoopts: Minor cleanup of ZFS options
Warner Losh [Fri, 10 Mar 2023 13:55:11 +0000 (06:55 -0700)]
opts: Minor cleanup of ZFS options

Remove redundant CPUARCH test: we really just want a plain MACHINE_ARCH
here.

Second, always turn off LOADER_ZFS when we turn off ZFS. Not 100%
required, but we did it some places and not others. There's no current
mechanism to say that if X is disabled then X_Y must be too.

Sponsored by: Netflix

14 months agotftpd: Gracefully skip tests if networking is not enabled.
Dag-Erling Smørgrav [Fri, 10 Mar 2023 13:25:00 +0000 (13:25 +0000)]
tftpd: Gracefully skip tests if networking is not enabled.

Sponsored by: Klara, Inc.
Reviewed by: asomers
Differential Revision: https://reviews.freebsd.org/D39012

14 months agotftp: Add tests.
Dag-Erling Smørgrav [Fri, 10 Mar 2023 13:24:56 +0000 (13:24 +0000)]
tftp: Add tests.

Sponsored by: Klara, Inc.
Reviewed by: asomers
Differential Revision: https://reviews.freebsd.org/D38969

14 months agotftpd: Don't forget to close stderr on startup.
Dag-Erling Smørgrav [Fri, 10 Mar 2023 13:24:50 +0000 (13:24 +0000)]
tftpd: Don't forget to close stderr on startup.

Just like stdin and stdout, stderr is a copy of the listen socket inherited from inetd.  We need to close it so inetd can process further requests, be restarted, etc.

Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D38968

14 months agotftpd: Don't consume arbitrary requests when failing to fork.
Dag-Erling Smørgrav [Fri, 10 Mar 2023 13:24:44 +0000 (13:24 +0000)]
tftpd: Don't consume arbitrary requests when failing to fork.

We've already consumed one request, which is sufficient to prevent inetd from endlessly restarting us in this particular and extremely unlikely case.

Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D38967

14 months agotftpd: Use poll() instead of alarm() + setjmp().
Dag-Erling Smørgrav [Fri, 10 Mar 2023 13:24:36 +0000 (13:24 +0000)]
tftpd: Use poll() instead of alarm() + setjmp().

While there, don't log an error when timing out waiting for a possible retransmit after a successful transfer.

Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D38966

14 months agotftpd: Make the -d option behave as documented.
Dag-Erling Smørgrav [Fri, 10 Mar 2023 13:24:32 +0000 (13:24 +0000)]
tftpd: Make the -d option behave as documented.

Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D38965

14 months agotftp: Correctly propagate transfer errors.
Dag-Erling Smørgrav [Fri, 10 Mar 2023 13:24:28 +0000 (13:24 +0000)]
tftp: Correctly propagate transfer errors.

Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D38958

14 months agotftpd: Make the transfer functions return success / failure.
Dag-Erling Smørgrav [Fri, 10 Mar 2023 13:24:23 +0000 (13:24 +0000)]
tftpd: Make the transfer functions return success / failure.

Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D38957

14 months agotftpd: Ensure that tftp_log() preserves errno.
Dag-Erling Smørgrav [Fri, 10 Mar 2023 13:24:19 +0000 (13:24 +0000)]
tftpd: Ensure that tftp_log() preserves errno.

Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D38956

14 months agotftpd: Fix max block size calculation.
Dag-Erling Smørgrav [Fri, 10 Mar 2023 13:24:15 +0000 (13:24 +0000)]
tftpd: Fix max block size calculation.

Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D38953

14 months agocontrib/bc: update to version 6.4.0
Stefan Eßer [Fri, 10 Mar 2023 10:33:33 +0000 (11:33 +0100)]
contrib/bc: update to version 6.4.0

This version contains a fix for an issue that can affect complex
bc scripts that use multiple read() functions that receive input from
an interactive user. The same value could be returned multiple times.

MFC after: 2 weeks

14 months agokern: physmem: don't create a new exregion for different flags...
Kyle Evans [Fri, 10 Mar 2023 05:27:39 +0000 (23:27 -0600)]
kern: physmem: don't create a new exregion for different flags...

... if the region we're adding is an exact match to one that we already
have.  Simply extend the flags of the existing entry as needed so that
we don't end up with duplicate regions.

It could be that we got the exclusion through two different means, e.g.,
FDT memreserve and the EFI memory map, and we may derive different
characteristics from each.  Apply the most restrictive set to the
region.

Reported by: Mark Millard <marklmi yahoo com>
Reviewed by: mhorne

14 months agocap_*(2): Document ENOSYS behavior.
Xin LI [Fri, 10 Mar 2023 02:10:50 +0000 (18:10 -0800)]
cap_*(2): Document ENOSYS behavior.

Summary:
All cap_* system calls would fail when capability mode support is
not present.

MFC after: 2 weeks
Reviewed by: emaste, pauamma
Differential Revision: https://reviews.freebsd.org/D38976

14 months agoheimdal: Fix CVE-2022-4152, signature validation error
Cy Schubert [Fri, 10 Mar 2023 01:03:52 +0000 (17:03 -0800)]
heimdal: Fix CVE-2022-4152, signature validation error

When CVE-2022-3437 was fixed by changing memcmp to be a constant
time and the workaround for th e compiler was to add "!=0". However
the logic implmented was inverted resulting in CVE-2022-4152.

Reported by: Timothy E Zingelman <zingelman _AT_ fnal.gov>
MFC after: 1 day
Security: CVE-2022-4152
Security: https://www.cve.org/CVERecord?id=CVE-2022-45142
Security: https://nvd.nist.gov/vuln/detail/CVE-2022-45142
Security: https://security-tracker.debian.org/tracker/CVE-2022-45142
Security: https://bugs.gentoo.org/show_bug.cgi?id=CVE-2022-45142
Security: https://bugzilla.samba.org/show_bug.cgi?id=15296
Security: https://www.openwall.com/lists/oss-security/2023/02/08/1

14 months agosctp: initial implementation of draft-tuexen-tsvwg-sctp-zero-checksum
Michael Tuexen [Fri, 10 Mar 2023 00:45:46 +0000 (01:45 +0100)]
sctp: initial implementation of draft-tuexen-tsvwg-sctp-zero-checksum

14 months agonetmap: Remove obsolete compatibility defines
Mark Johnston [Thu, 9 Mar 2023 23:16:53 +0000 (18:16 -0500)]
netmap: Remove obsolete compatibility defines

No functional change intended.

Reviewed by: vmaffione
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39001

14 months agoAdd WITH_LOADER_VERIEXEC_VECTX description
Brooks Davis [Thu, 9 Mar 2023 21:39:41 +0000 (21:39 +0000)]
Add WITH_LOADER_VERIEXEC_VECTX description

PR: 270017
Reviewed by: emaste
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D39002

14 months agoinclude: Remove no longer existing netgraph/atm
Michael Butler [Thu, 9 Mar 2023 21:39:41 +0000 (21:39 +0000)]
include: Remove no longer existing netgraph/atm

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D39005

14 months agoman5/rc.conf.5: finally retire references to pccard_ifconfig variable
Ceri Davies [Thu, 9 Mar 2023 21:38:46 +0000 (21:38 +0000)]
man5/rc.conf.5: finally retire references to pccard_ifconfig variable

It was removed in June 2005.

14 months agoman5/rc.conf.5: minor nitpicks to formatting, grammar, spelling
Ceri Davies [Thu, 9 Mar 2023 21:35:03 +0000 (21:35 +0000)]
man5/rc.conf.5: minor nitpicks to formatting, grammar, spelling

14 months agorc.conf: update comment referring to /etc/motd
Ceri Davies [Thu, 9 Mar 2023 21:28:30 +0000 (21:28 +0000)]
rc.conf: update comment referring to /etc/motd

14 months agopkg(7): now that we do use libmd, use it completly
Baptiste Daroussin [Thu, 9 Mar 2023 20:29:15 +0000 (21:29 +0100)]
pkg(7): now that we do use libmd, use it completly

Use SHA256_Fd and SHA256_Data instead of home made equivalent.
wrap those functions into hash.c to avoid header collition between
openssl and libmd

Suggested by: kevans

14 months agoman5/rc.conf.5: document hostid and machine-id related variables
Ceri Davies [Thu, 9 Mar 2023 20:05:52 +0000 (20:05 +0000)]
man5/rc.conf.5: document hostid and machine-id related variables

14 months agoRemove WITH(OUT)_ATM option
Brooks Davis [Thu, 9 Mar 2023 18:04:36 +0000 (18:04 +0000)]
Remove WITH(OUT)_ATM option

With the removal of NgATM it no longer controls anything.

Reviewed by: manu, emaste
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D38882

14 months agong_atmllc: remove
Brooks Davis [Thu, 9 Mar 2023 18:04:21 +0000 (18:04 +0000)]
ng_atmllc: remove

This standalone module is the last vestage of ATM support in the tree so
send it on its way.

Reviewed by: manu, emaste
Relnotes: yes
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D38880

14 months agoNgATM: Remove netgraph ATM support
Brooks Davis [Thu, 9 Mar 2023 18:04:02 +0000 (18:04 +0000)]
NgATM: Remove netgraph ATM support

Most ATM support was removed prior to FreeBSD 12.  The netgraph support
was kept as it was less intrusive, but it is presumed to be unused.

Reviewed by: manu
Relnotes: yes
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D38879

14 months agopkg(7): use libmd for sha256 instead of openssl
Baptiste Daroussin [Thu, 9 Mar 2023 16:38:30 +0000 (17:38 +0100)]
pkg(7): use libmd for sha256 instead of openssl

OpenSSL 3.0 has deprecated the sha256 api, let's use libmd which has the
same API instead.

In order to avoid the collision in definitions (sha256.h cannot be
included in the same file as a file where openssl headers has been
included) let's move the sha256 related code in its own file

PR: 270023
Reported by: ngie

14 months agovm_fault: Update a comment to reflect the removal of the default pager
Mark Johnston [Thu, 9 Mar 2023 16:15:49 +0000 (11:15 -0500)]
vm_fault: Update a comment to reflect the removal of the default pager

Fixes: 5d32157d4e5c ("vm_object: Modify vm_object_allocate_anon() to return OBJT_SWAP objects")
Reviewed by: alc, kib
Differential Revision: https://reviews.freebsd.org/D38985

14 months agoxen: fetch dom0 video console information from Xen
Roger Pau Monné [Mon, 21 Nov 2022 11:40:08 +0000 (12:40 +0100)]
xen: fetch dom0 video console information from Xen

It's possible for Xen to switch the video mode set by the boot loader,
so that the information passed in the kernel metadata is no longer
valid.  Fetch the video mode used by Xen using an hypercall and update
the medatada for the kernel to use the correct video mode.

Sponsored by: Citrix Systems R&D

14 months agoxen: bump used interface version
Roger Pau Monné [Mon, 21 Nov 2022 15:21:16 +0000 (16:21 +0100)]
xen: bump used interface version

This is required for a further change that will make use of a field
that was added in version 0x00040d00.

No functional change expected.

Sponsored by: Citrix Systems R&D

14 months agofix buildworld after 595d23f777dc.
Alexander V. Chernikov [Thu, 9 Mar 2023 15:44:59 +0000 (15:44 +0000)]
fix buildworld after 595d23f777dc.

Reported by: se

14 months agonvmecontrol: Fix default ns create parameters.
Alexander Motin [Thu, 9 Mar 2023 15:19:00 +0000 (10:19 -0500)]
nvmecontrol: Fix default ns create parameters.

Instead of passing 0xff's for all unset parameters, prefer reasonable
defaults.  It is much easier to use it this was without specs in hand.

MFC after: 1 week

14 months agonetlink: add snl(3) default parsers for routes and links.
Alexander V. Chernikov [Thu, 9 Mar 2023 14:43:56 +0000 (14:43 +0000)]
netlink: add snl(3) default parsers for routes and links.

This change adds the "default" parsers of _all_ route/link attributes
 exported by the kernel.
It removes the need to declare similar parsers in the userland applications,
 simplifying their logic.

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

14 months agonetlink: add rtsock-compatible header to use with netlink snl(3).
Alexander V. Chernikov [Thu, 9 Mar 2023 14:36:52 +0000 (14:36 +0000)]
netlink: add rtsock-compatible header to use with netlink snl(3).

Some routing socket defines (`RTM_` and `RTA_` ones) clash with the ones
 used by the the Netlink.
As some rtsock definitions like interface flags or route flags are used in
 both netlink and rtsock, provide a convenient way to include those without
 running into the define collision.

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

14 months agonetlink: add basic message writing support to snl(3).
Alexander V. Chernikov [Thu, 9 Mar 2023 14:33:26 +0000 (14:33 +0000)]
netlink: add basic message writing support to snl(3).

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

14 months agorc.d: Generate machine-id from hostid_save
Tijl Coosemans [Wed, 15 Feb 2023 20:09:51 +0000 (21:09 +0100)]
rc.d: Generate machine-id from hostid_save

rc.d/hostid_save saves a UUID generated by rc.d/hostid in /etc/hostid.
Store the same UUID, without hyphens, in /etc/machine-id.  The hypĥens
are removed with a shell function because hostid_save runs before file
systems are mounted so other tools may not be available yet.

This eliminates some duplication between hostid and machine-id and for
virtual machines machine-id now contains the UUID configured in the
hypervisor like it does on Linux.

Reviewed by: delphij
Discussed with: bapt
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D38811

14 months agohostid: Generate random UUID by default
Tijl Coosemans [Thu, 9 Mar 2023 09:02:45 +0000 (10:02 +0100)]
hostid: Generate random UUID by default

This way MAC addresses are no longer exposed.

Discussed with: bapt
MFC after: 3 days

14 months agogrep: remove tautological condition
Kyle Evans [Thu, 9 Mar 2023 05:53:10 +0000 (23:53 -0600)]
grep: remove tautological condition

st_size is an off_t, it cannot hold values larger than OFF_MAX.

CID: 1008931

14 months agoRevert "grep: remove tautological condition"
Kyle Evans [Thu, 9 Mar 2023 05:52:23 +0000 (23:52 -0600)]
Revert "grep: remove tautological condition"

This reverts commit f6d6c66889001208aee7b0c46efe1c8ddffda57c.

Gremlins snuck into my tree and injected some WIP.

14 months agogrep: remove tautological condition
Kyle Evans [Thu, 9 Mar 2023 05:29:30 +0000 (23:29 -0600)]
grep: remove tautological condition

st_size is an off_t, it cannot hold values larger than OFF_MAX.

CID: 1008931

14 months agosrc.conf.5: Use common phrasing in WITHOUT_OFED text
Ed Maste [Thu, 9 Mar 2023 02:18:37 +0000 (21:18 -0500)]
src.conf.5: Use common phrasing in WITHOUT_OFED text

Reported by: jhb
Sponsored by: The FreeBSD Foundation

14 months agosrc.conf.5: Add some WITH_/WITHOUT_ option descriptions
Ed Maste [Tue, 7 Mar 2023 18:49:23 +0000 (13:49 -0500)]
src.conf.5: Add some WITH_/WITHOUT_ option descriptions

Reviewed by: markj, brooks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38961

14 months agonvram2env: Retire unused MIPS-specific driver
Ed Maste [Wed, 8 Mar 2023 17:22:29 +0000 (12:22 -0500)]
nvram2env: Retire unused MIPS-specific driver

This code was used only on MIPS platforms, and has not built in some
time.

Reviewed by: ray
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38986

14 months agosys/modules/Makefile: Add a section for arm64 + x86 + powerpc64.
John Baldwin [Wed, 8 Mar 2023 23:12:25 +0000 (15:12 -0800)]
sys/modules/Makefile: Add a section for arm64 + x86 + powerpc64.

This reduces some duplication between the existing arm64 + x86 section
and the powerpc64 section.  To make the diff simpler, enable mlx4 on
powerpc64 since it compiles.

Reviewed by: pkubaj, imp, emaste
Differential Revision: https://reviews.freebsd.org/D38973

14 months agoEnable OFED on all platforms except for 32-bit arm.
John Baldwin [Wed, 8 Mar 2023 23:07:11 +0000 (15:07 -0800)]
Enable OFED on all platforms except for 32-bit arm.

32-bit arm triggers multiple -Wunaligned-access errors due to
structure packing.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D38972

14 months agokrping: Use get_cyclecount for get_cycles.
John Baldwin [Wed, 8 Mar 2023 23:06:59 +0000 (15:06 -0800)]
krping: Use get_cyclecount for get_cycles.

This avoids having to duplicate identical MD code.

Reviewed by: np, emaste
Differential Revision: https://reviews.freebsd.org/D38971

14 months agoarch.7: Drop most mentions of MIPS.
John Baldwin [Wed, 8 Mar 2023 23:06:26 +0000 (15:06 -0800)]
arch.7: Drop most mentions of MIPS.

Only keep MIPS in the list of deprecated architectures.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D38970

14 months agoMake <sys/systm.h> more self-contained.
John Baldwin [Wed, 8 Mar 2023 23:05:10 +0000 (15:05 -0800)]
Make <sys/systm.h> more self-contained.

Replace <sys/cdefs.h> with <sys/types.h>.  Other includes need types
defined in <sys/types.h> and <sys/types.h> includes <sys/cdefs.h>
already.

While here, move the <machine/*.h> headers below the <sys/*.h>
headers.

Reviewed by: imp, kib
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D38841

14 months agomakeman: replace -\|/ twiddles with dots
Brooks Davis [Wed, 8 Mar 2023 21:01:17 +0000 (21:01 +0000)]
makeman: replace -\|/ twiddles with dots

It shows progress more clearly, there aren't so many that the output
is excessive, and it's more friendly for things like Cirrus-CI's
logging that print the backspaces as boxes.

Reviewed by: emaste
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D38990

14 months agosrc.conf.5: regen without $FreeBSD$
Brooks Davis [Wed, 8 Mar 2023 21:01:17 +0000 (21:01 +0000)]
src.conf.5: regen without $FreeBSD$

14 months agomakeman: don't insert a $FreeBSD$
Brooks Davis [Wed, 8 Mar 2023 21:01:17 +0000 (21:01 +0000)]
makeman: don't insert a $FreeBSD$

There's no need to insert this line which won't be expanded in git.  Not
generating it won't impact MFCs to 12 since the removal won't be MFCd.

Reviewed by: emaste
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D38989

14 months agomakeman: fix a whitespace bug
Brooks Davis [Wed, 8 Mar 2023 21:01:17 +0000 (21:01 +0000)]
makeman: fix a whitespace bug

Reviewed by: emaste
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D38988

14 months agodpaa2_mc.c: unbreak by adding <sys/lock.h>
Joerg Wunsch [Wed, 8 Mar 2023 20:48:14 +0000 (21:48 +0100)]
dpaa2_mc.c: unbreak by adding <sys/lock.h>

When compiling current on arm64, it breaks since LA_UNLOCKED is
undefined. This was in turn caused by the mutex code aliasing
it as MA_NOTOWNED.

Add <sys/lock.h> so the macro is defined.

14 months agoAdd NAMESPACE MANAGEMENT into admin_opcode[].
Alexander Motin [Wed, 8 Mar 2023 20:42:31 +0000 (15:42 -0500)]
Add NAMESPACE MANAGEMENT into admin_opcode[].

MFC after: 1 week

14 months agousb: dwc3: add <sys/mutex.h>
Joerg Wunsch [Wed, 8 Mar 2023 19:59:29 +0000 (20:59 +0100)]
usb: dwc3: add <sys/mutex.h>

Commit 5e54bb1ea9e90 added USB_BUS_LOCK/USB_BUS_UNLOCK. They, in
consequence, require mutexes so <sys/mutex.h> is needed.

14 months agomsdosfs: fix debug print format and parameter
Stefan Eßer [Wed, 8 Mar 2023 16:58:00 +0000 (17:58 +0100)]
msdosfs: fix debug print format and parameter

Building with -DMSDOSFS_DEBUG failed due to a format mismatch and
a variable that has been renamed but not updated in the printf()
parameter list.

MFC after: 1 month

14 months agodpaa2: Mechanically convert to IfAPI
Justin Hibbits [Tue, 7 Mar 2023 16:45:19 +0000 (11:45 -0500)]
dpaa2: Mechanically convert to IfAPI

Reviewed By: zlei
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38959

14 months agoeqos: Mechanically convert to IfAPI
Justin Hibbits [Tue, 7 Mar 2023 21:27:35 +0000 (16:27 -0500)]
eqos: Mechanically convert to IfAPI

Reviewed by: zlei
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38963

14 months agonetlink: make snl(3) scratch buffer growable
Alexander V. Chernikov [Wed, 8 Mar 2023 11:17:43 +0000 (11:17 +0000)]
netlink: make snl(3) scratch buffer growable

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

14 months agoFFS/UFS snapshots: improve documentation for removal (deletion) and unlinking.
Kirk McKusick [Wed, 8 Mar 2023 06:02:07 +0000 (22:02 -0800)]
FFS/UFS snapshots: improve documentation for removal (deletion) and unlinking.

Clarification of the size of the snapshot file.

Suggested by: Matteo Riondato
PR:           266358
MFC after:    2 weeks
Differential Revision: https://reviews.freebsd.org/D38817

14 months agoacpica: do not print warning for missing _ADR
Yuri [Tue, 7 Mar 2023 23:22:58 +0000 (16:22 -0700)]
acpica: do not print warning for missing _ADR

Started seeing the following after updating to VMware ESXi 8.0:

pcib2: <ACPI Host-PCI bridge> on acpi0
pcib2: could not evaluate _ADR - AE_NOT_FOUND
pci2: <ACPI PCI bus> on pcib2
vmx0: <VMware VMXNET3 Ethernet Adapter> ...

The virtual NIC works fine, and the code comment suggests that
missing _ADR is not something fatal, skip printing the message
if status is AE_NOT_FOUND.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/682

14 months agoCorrect several bugs in fsck_ffs(8) triggered by corrupted filesystems.
Kirk McKusick [Tue, 7 Mar 2023 23:12:37 +0000 (15:12 -0800)]
Correct several bugs in fsck_ffs(8) triggered by corrupted filesystems.

If a directory entry has an illegal inode number (less than zero
or greater than the last inode in the filesystem) the entry is removed.
If a directory '.' or '..' entry had an illegal inode number they
were being removed. Since fsck_ffs knows what the correct value is
for these two entries fix them rather deleting them.

Add much more extensive cylinder group checks and use them to be
more careful about rebuilding a cylinder group.

Check for out-of-range block numbers before trying to free them.

When a directory is deleted also remove its cache entry created
in pass1 so that later passes do not try to operate on a deleted
directory.

Check for ctime(3) returning NULL before trying to use its return.

When freeing a  directory inode, do not try to interpret it as a
directory.

Reserve space in the inostatlist to have room to allocate a
lost+found directory.

If an invalid block number is found past the end of an inode simply
remove it rather than clearing and removing the inode.

Modernize the inoinfo structure to use queue(3) LIST rather than a
handrolled linked list implementation.

Reported by:  Bob Prohaska, John-Mark Gurney, and Mark Millard
Tested by:    Peter Holm
Reviewed by:  Peter Holm
MFC after:    2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38668

14 months agoRevert "Fix cross-build support for Ubuntu 16.04"
Jose Luis Duran [Thu, 2 Mar 2023 15:31:31 +0000 (08:31 -0700)]
Revert "Fix cross-build support for Ubuntu 16.04"

This reverts commit d6327ae8c11b73765f100981baca49166b558b70.

Before version 2.25, glibc's unistd.h would define the POSIX subset of
getopt.h by defining __need_getopt, including getopt.h (which would
disable the header guard) and then undefining it so later including
getopt.h explicitly would define the extensions. However, we wrap
getopt, and so the wrapper's #pragma once breaks that. Thus getopt.h was
included before the real unistd.h to ensure we get all the extensions.

However, with clang 12 that causes problems where we get a function
mismatch (since getopt can throw exceptions). If we include it after
unistd.h, it will get the full definitions since glibc no longer does
the subsetting thing. This will result in matching definitions and fix
clang 12.

Reviewed by: imp, jrtc27 (OK'd on irc)
Pull Request: https://github.com/freebsd/freebsd-src/pull/668

14 months agoUpdates to UFS/FFS superblock integrity checks when reading a superblock.
Kirk McKusick [Tue, 7 Mar 2023 22:59:56 +0000 (14:59 -0800)]
Updates to UFS/FFS superblock integrity checks when reading a superblock.

Have to add a check that the computed cylinder group size does not
exceed the block size of the filesystem.

It is also necessary to validate additional parameters when a
superblock is going to be used in read-only mode if its supplementary
information is going to be read in to ensure that the size and
location of the supplementary information is valid. Also when a
warning is raised let it be accepted, but bound the flagged field
to the value checked by the warning.

No legitimate superblocks should fail as a result of these changes.

Reported by:  Bob Prohaska, John-Mark Gurney, and Mark Millard
Tested by:    Peter Holm
Reviewed by:  Peter Holm
MFC after:    2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38668

14 months agosrc.opts.mk: Remove long-unused NDIS option
Ed Maste [Tue, 7 Mar 2023 19:03:27 +0000 (14:03 -0500)]
src.opts.mk: Remove long-unused NDIS option

NDIS was removed a couple of years ago, but the src.conf knob was left
behind.

Fixes: bfc99943b04b ("ndis(4): remove as previous announced")
Sponsored by: The FreeBSD Foundation

14 months agoMechanically convert cxgb(4) and cxgbe(4) to IfAPI
Justin Hibbits [Mon, 30 May 2022 19:39:59 +0000 (14:39 -0500)]
Mechanically convert cxgb(4) and cxgbe(4) to IfAPI

Reviewed by: np
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38597

14 months agoMechanically convert qlxgbe(4) to IfAPI
Justin Hibbits [Wed, 17 Aug 2022 20:27:58 +0000 (16:27 -0400)]
Mechanically convert qlxgbe(4) to IfAPI

Reviewed by: zlei
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37821

14 months agoMechanically convert qlxgb(4) to IfAPI
Justin Hibbits [Wed, 17 Aug 2022 20:27:29 +0000 (16:27 -0400)]
Mechanically convert qlxgb(4) to IfAPI

Reviewed by: zlei
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37820

14 months agoMechanically convert qlxge(4) to IfAPI
Justin Hibbits [Wed, 17 Aug 2022 20:26:49 +0000 (16:26 -0400)]
Mechanically convert qlxge(4) to IfAPI

Reviewed by: zlei
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37819

14 months agosrc.opts.mk: sync FDT and OFED options with kern.opts.mk
Ed Maste [Tue, 7 Mar 2023 16:39:46 +0000 (11:39 -0500)]
src.opts.mk: sync FDT and OFED options with kern.opts.mk

Where options exist in both src.opts.mk and kern.opts.mk they should be
kept in sync.

It may be that the option should be flipped the other way (e.g.,
enabling OFED in the kernel on arm64); if so that will be done as a
subsequent commit after further testing.

PR: 269994
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D38952

14 months agonetlink: cleanup netlink_writer code
Alexander V. Chernikov [Tue, 7 Mar 2023 17:42:27 +0000 (17:42 +0000)]
netlink: cleanup netlink_writer code

* Remove unused nlattr_add_nla() - that's a duplicate of nlattr_add_raw().
* Calculate alignment only once in nlmsg_reserve_data_raw()

MFC after: 2 weeks

14 months agoarm64: fix the LINT-ACPI build
Kyle Evans [Tue, 7 Mar 2023 17:37:31 +0000 (11:37 -0600)]
arm64: fix the LINT-ACPI build

This file uses VM_MEMATTR_DEVICE_NP, which it gets through header
pollution somewhere with FDT enabled.  Pull in vm/vm.h to make it
explicit.

14 months agotests: add more netlink tests for neighbors/routes
Alexander V. Chernikov [Tue, 7 Mar 2023 17:30:35 +0000 (17:30 +0000)]
tests: add more netlink tests for neighbors/routes

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

14 months agolibc: Remove prototype and documentation for tzsetwall().
Dag-Erling Smørgrav [Tue, 7 Mar 2023 16:04:29 +0000 (16:04 +0000)]
libc: Remove prototype and documentation for tzsetwall().

PR: 269445
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D38481

14 months agobyacc: Disable backtracking extension.
Dag-Erling Smørgrav [Tue, 7 Mar 2023 16:04:24 +0000 (16:04 +0000)]
byacc: Disable backtracking extension.

When updating byacc to 20230201, I enabled the backtracking extension as it seemed useful and harmless.  With a little more experience, it appears to have more impact than I initially thought and I'm no longer sure how useful it really is, so turn it back off.

PR: 244149, 269425
Sponsored by: Klara, Inc.
Reviewed by: imp, jkim
Differential Revision: https://reviews.freebsd.org/D38931

14 months agotarfs: Set mountedfrom correctly.
Dag-Erling Smørgrav [Tue, 7 Mar 2023 16:04:18 +0000 (16:04 +0000)]
tarfs: Set mountedfrom correctly.

Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Reviewed by: sjg, kib
Differential Revision: https://reviews.freebsd.org/D38930

14 months agoaltera: Fix build from 068f2c0e10
Justin Hibbits [Tue, 7 Mar 2023 16:42:09 +0000 (11:42 -0500)]
altera: Fix build from 068f2c0e10

Missed the altera dwc driver in the conversion.

Fixes: 068f2c0e10
Sponsored by: Juniper Networks, Inc.

14 months agobhyve: Move libcasper dependecy to lib9p
Vitaliy Gusev [Tue, 7 Mar 2023 16:09:22 +0000 (11:09 -0500)]
bhyve: Move libcasper dependecy to lib9p

libcasper(3) is not used in bhyve. So move dependency to the appropriate
place.

Reviewed by: markj
MFC after: 1 week
Sponsored by: vStack
Differential Revision: https://reviews.freebsd.org/D38905

14 months ago.gitignore: Ignore LSP generated .cache
Jake Freeland [Tue, 7 Mar 2023 15:04:18 +0000 (10:04 -0500)]
.gitignore: Ignore LSP generated .cache

Language servers like clangd generate a .cache directory to store
compilation cache. Tell Git to ignore this directory when staging files.

Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D38937

14 months agoMechanically convert dwc(4) to IfAPI
Justin Hibbits [Sat, 20 Aug 2022 02:04:32 +0000 (22:04 -0400)]
Mechanically convert dwc(4) to IfAPI

Reviewed by: manu (older)
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D37846

14 months agocpsw(4): Finish conversion to IfAPI
Justin Hibbits [Mon, 6 Mar 2023 21:27:27 +0000 (16:27 -0500)]
cpsw(4): Finish conversion to IfAPI

Two ifnet accesses were missed in 2c7bc0f55.

Sponsored by: Juniper Networks, Inc.

14 months agolinux: Use the if_name() accessor to get loopback name
Justin Hibbits [Mon, 6 Mar 2023 16:36:31 +0000 (11:36 -0500)]
linux: Use the if_name() accessor to get loopback name

Avoid directly accessing the if_xname ifnet member. and use the
designated accessor function instead.

Sponsored by: Juniper Networks, Inc.

14 months agoktls: Use IfAPI accessors to get capabilities
Justin Hibbits [Mon, 6 Mar 2023 18:28:26 +0000 (13:28 -0500)]
ktls: Use IfAPI accessors to get capabilities

Summary:
Avoid referencing the ifnet struct directly, and use the IfAPI accessors
instead.

Reviewed by: gallatin
Sponsored by: Juniper Networks, Inc.
Differential Revision: https://reviews.freebsd.org/D38932

14 months agoiflib: Further convert to use IfAPI accessors
Justin Hibbits [Mon, 6 Mar 2023 16:38:05 +0000 (11:38 -0500)]
iflib: Further convert to use IfAPI accessors

Summary:
When iflib was first converted some IfAPI APIs were not yet present, so
were tagged with "XXX" comments.  Finish the conversion by using these
new APIs.

Reviewed by: gallatin, erj
Sponsored by: Juniper Networks, Inc
Differential Revision: https://reviews.freebsd.org/D38928

14 months agocarp tests: ensure exactly one jail is master
Kristof Provost [Mon, 6 Mar 2023 12:33:50 +0000 (13:33 +0100)]
carp tests: ensure exactly one jail is master

Verify that we only have one master, not two.

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

14 months agoarm64: ofw: respect the nonposted-mmio prop in OF_decode_addr()
Kyle Evans [Tue, 7 Mar 2023 06:15:32 +0000 (00:15 -0600)]
arm64: ofw: respect the nonposted-mmio prop in OF_decode_addr()

This is the only mapping remaining which needs to respect nonposted-mmio
to avoid breaking the boot on Apple silicon.

Reviewed by: andrew
Differential Revision: https://reviews.freebsd.org/D38920