]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
14 months agoifconfig: make interface and address listing use Netlink as transport
Alexander V. Chernikov [Wed, 10 May 2023 13:58:21 +0000 (13:58 +0000)]
ifconfig: make interface and address listing use Netlink as transport

Differential Revision: https://reviews.freebsd.org/D40044

14 months agonetlink: add support for adding/deleting interface addresses
Alexander V. Chernikov [Mon, 15 May 2023 11:59:39 +0000 (11:59 +0000)]
netlink: add support for adding/deleting interface addresses

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

14 months agonet80211: Radiotap: update for newer standards (add EHT, U-SIG)
Bjoern A. Zeeb [Tue, 16 May 2023 16:03:17 +0000 (16:03 +0000)]
net80211: Radiotap: update for newer standards (add EHT, U-SIG)

iwlwifi already uses suggested EHT and U-SIG bits as well as some
more TLV bits.  Update radiotap to know of those even if they might
get updated again in the future in order to get newer versions of
the driver to compile.

Sponsored by: The FreeBSD Foundation
MFC after: 10 days

14 months agotesting: improve vnet support in pytest
Alexander V. Chernikov [Tue, 16 May 2023 15:00:45 +0000 (15:00 +0000)]
testing: improve vnet support in pytest
* Allow vnet object to be directly referenced
 (self.vnet1 vs self.vnet_map["vnet1"])
* Allow iface object to be directly reference
 (vnet.bridge vs vnet.iface_alias_map["bridge"])
* Allow arbitrary interface alias names insted of ifX
* Add wait_objects_any() method for waiting object from
 multiple vnets
* Add wait() method for indefinite sleep on vnet handlers

MFC after: 2 weeks

14 months agopasswd.5: Update man page after e0155c6989049da43c5499f7129002aa17d1ca79
Jose Luis Duran [Tue, 16 May 2023 11:17:16 +0000 (11:17 +0000)]
passwd.5: Update man page after e0155c6989049da43c5499f7129002aa17d1ca79

MFC After: 3 days

14 months agopasswd.5: Remove .Tn (Trade Name) macros
Jose Luis Duran [Tue, 16 May 2023 11:18:53 +0000 (11:18 +0000)]
passwd.5: Remove .Tn (Trade Name) macros

To appease mandoc -T lint, remove .Tn macros.

MFC After: 3 days

14 months agopw: The pw_checkname function has added ';' checking.
pbuff [Tue, 16 May 2023 03:05:30 +0000 (11:05 +0800)]
pw: The pw_checkname function has added ';' checking.

The pw_checkname function forgot to include a ';'
when checking usernames, causing shell commands
to be executed when a username with a ';' is deleted.

PR: 271427
MFC After: 3 days

14 months agotests: Don't recurse into sys/compat32
Jessica Clarke [Tue, 16 May 2023 01:06:34 +0000 (02:06 +0100)]
tests: Don't recurse into sys/compat32

Stubbing out the whole file means it has no targets, so recursive makes
fail with "don't know how to make X". We could fix that, but because the
level above is adding it to TESTS_SUBDIRS it'll generate an include line
for the subdirectory in its Kyuafile, which won't work (the problem that
was previously seen on non-aarch64 in CI). Thus we really need to not
even add it to TESTS_SUBDIRS in the first place.

Reported by: Dan Mack <mack@macktronics.com>
Fixes: 28f66935d400 ("tests: Disable sys/compat32 and sys/compat32/aarch64 tests")

14 months agotests: Disable sys/compat32 and sys/compat32/aarch64 tests
Jessica Clarke [Mon, 15 May 2023 22:16:40 +0000 (23:16 +0100)]
tests: Disable sys/compat32 and sys/compat32/aarch64 tests

The former has build system issues, with missing Kyuafiles, presumably
due to not using TESTS_SUBDIRS and bsd.test.mk (and possibly some issues
on top of that around TESTSDIR and related variables). The latter has
issues with GCC and cut-down LLVM builds.

Requested by: kevans
Fixes: ccb59683b983 ("arm64: add tests for swp/swpb emulation")

14 months agonvmecontrol: Fix power subcommand output.
Alexander Motin [Mon, 15 May 2023 20:48:50 +0000 (16:48 -0400)]
nvmecontrol: Fix power subcommand output.

The returned value consists of two fields.  Report them separately.

MFC after: 2 weeks

14 months agodirdeps.mk allow for TARGET_SPEC_VARS.host
Simon J. Gerraty [Mon, 15 May 2023 20:25:10 +0000 (13:25 -0700)]
dirdeps.mk allow for TARGET_SPEC_VARS.host

While *most* projects need only DEP_MACHINE for host, there is always
an exception.  So we allow for TARGET_SPEC_VARS.host to be a subset of
TARGET_SPEC_VARS.  The default will *just work* for most projects.

We set DEP_TARGET_SPEC_VARS and hence DEP_TARGET_SPEC based on
DEP_MACHINE.  Allow for M_dep_qual_fixes.host to be different too and
take care to apply the right set.

14 months agoFix size differences between architectures of the UFS/FFS CGSIZE macro value.
Kirk McKusick [Mon, 15 May 2023 19:56:27 +0000 (12:56 -0700)]
Fix size differences between architectures of the UFS/FFS CGSIZE macro value.

The cylinder group header structure ended with `u_int8_t cg_space[1]'
representing the beginning of the inode bitmap array. Some architectures
like the i386 rounded this up to a 4-byte boundry while other
architectures like the amd64 rounded it up to an 8-byte boundry.
Thus sizeof(struct cg) was four bytes bigger on an amd64 machine
than on an i386 machine. If a filesystem created on an i386 machine
was moved to an amd64 machine, the size of the cylinder group
calculated by the CGSIZE macro would appear to grow by four bytes.
Filesystems whose cylinder groups were exactly equal to the block
size on an i386 machine would appear to have a cylinder group that
was four bytes too big when moved to an amd64 machine. Note that
although the structure appears to be too big, it in fact is fine.
It is just the calaculation of its size that is in error.

The fix is to remove the cg_space element from the cylinder-group
structure so that the calculated size of the structure is the same
size on all architectures.

Reported by:  Tijl Coosemans
Tested by:    Tijl Coosemans and Peter Holm
MFC after:    1 week
Sponsored by: The FreeBSD Foundation

14 months agoarm64: simplify expression
Kyle Evans [Mon, 15 May 2023 15:54:15 +0000 (10:54 -0500)]
arm64: simplify expression

!a != !b -> a != b; this part was lifted from NetBSD, and I clearly did
not reconsider that these are bools (I'm guessing they were ints in an
earlier iteration of the NetBSD implementation).

while we're here, it should be easy to see that we've covered all of the
cases but let's add in an __assert_unreachable() to make it easier on
the eyes.

Reported by: jrtc27

14 months agoarm64: add tests for swp/swpb emulation
Kyle Evans [Mon, 15 May 2023 15:42:16 +0000 (10:42 -0500)]
arm64: add tests for swp/swpb emulation

One test is suitable to be hooked up to the build, so I've done this
here.  The other test lives in tools/regression because failure is a
bit more subjective -- generally, one runs it for some unbounded amount
of time and observe if it eventually exits because two threads acquired
the same mutex.

Reviewed by: imp, mmel
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D39668

14 months agoarm64: emulate swp/swpb instructions
Kyle Evans [Mon, 15 May 2023 15:42:10 +0000 (10:42 -0500)]
arm64: emulate swp/swpb instructions

Add another undefined instruction handler for compat32 and watch out for
SWP/SWPB instructions.

SWP/SWPB were deprecated in ARMv6 and declared obsolete in ARMv7, but
this implementation is motivated by some proprietary software that still
uses SWP/SWPB. Because it's deprecated, emulation is pushed back behind
a sysctl that defaults to OFF in GENERIC so that it doesn't potentially
adversely affect package builds; it's unknown whether software may test
for a functional swp/swpb instruction with the desire of using it later,
so we err on the side of caution to ensure we don't end up with swp/swpb
use in freebsd/arm packages (which are built on aarch64).

The EMUL_SWP config option may be used to enable emulation by default in
environments where emulation is desired and won't really be turned off.

Reviewed by: andrew, mmel (both earlier version)
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D39667

14 months agoifconfig: split printing functions into smaller per-type chunks.
Alexander V. Chernikov [Mon, 15 May 2023 12:17:54 +0000 (12:17 +0000)]
ifconfig: split printing functions into smaller per-type chunks.

This change is a prerequisite for netlink conversion.
No functional changes intended.

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

14 months agotesting: rename IfattrType to IfaAttrType for consistency
Alexander V. Chernikov [Mon, 15 May 2023 11:47:07 +0000 (11:47 +0000)]
testing: rename IfattrType to IfaAttrType for consistency

All other attribute classes are named as 'type'AttrType and 'type'
 int this case is ifa (interface address).

MFC after: 2 weeks

14 months agonetlink: add an optional post-process hook to the message parsers.
Alexander V. Chernikov [Mon, 15 May 2023 11:33:10 +0000 (11:33 +0000)]
netlink: add an optional post-process hook to the message parsers.

It is primarily used for adding scopeid to the IPv6 link-local
 sockaddrs. Having proper sockaddrs after parsing minimises the
 possibility of human mistake when using the parsing.

MFC after: 2 weeks

14 months agotesting: add public method for requiring module presense in pytest
Alexander V. Chernikov [Mon, 15 May 2023 10:50:55 +0000 (10:50 +0000)]
testing: add public method for requiring module presense in pytest

MFC after: 2 weeks

14 months agotesting: add support for handling Netlink carp messages
Alexander V. Chernikov [Mon, 15 May 2023 10:48:45 +0000 (10:48 +0000)]
testing: add support for handling Netlink carp messages

MFC after: 2 weeks

14 months agotesting: add support for using custom interfaces in pytest framework.
Alexander V. Chernikov [Mon, 15 May 2023 10:44:20 +0000 (10:44 +0000)]
testing: add support for using custom interfaces in pytest framework.

MFC after: 2 weeks

14 months agogeli: fix typo
Mariusz Zaborski [Mon, 15 May 2023 08:44:17 +0000 (10:44 +0200)]
geli: fix typo

PR: 271396
Reported by: Tim Chase <freebsd@tim.thechases.com>
MFC after: 1 week

14 months agoperiodic: Use locale-agnostic (ISO 8601) timestamp format
Michael Osipov [Thu, 4 May 2023 12:35:59 +0000 (14:35 +0200)]
periodic: Use locale-agnostic (ISO 8601) timestamp format

Instead of reyling on locale-sensitive output which can be mangled when e-mailed
use consistently ISO 8601 format which contains the same information as '-T'.

PR: 271240
MFC After: 3 days

14 months agodma: install a simple example for the auth.conf file
Peter Wright [Mon, 15 May 2023 07:18:40 +0000 (09:18 +0200)]
dma: install a simple example for the auth.conf file

PR: 270088
MFC After: 3 days

14 months agopci_vendors: update to 2023-05-15
Baptiste Daroussin [Mon, 15 May 2023 07:09:29 +0000 (09:09 +0200)]
pci_vendors: update to 2023-05-15

MFC After: 3 days

14 months agopw: do not call system()
Baptiste Daroussin [Mon, 15 May 2023 06:55:08 +0000 (08:55 +0200)]
pw: do not call system()

Calling system makes pw(8) spawn a shell, which can then be abused.

MFC After: 3 days

14 months agoremove stale portsinfo script
Wolfram Schneider [Mon, 15 May 2023 06:34:20 +0000 (06:34 +0000)]
remove stale portsinfo script

14 months agoremove stale handbook scripts
Wolfram Schneider [Mon, 15 May 2023 06:30:34 +0000 (06:30 +0000)]
remove stale handbook scripts

14 months agoremove stale message-id scripts
Wolfram Schneider [Mon, 15 May 2023 06:29:39 +0000 (06:29 +0000)]
remove stale message-id scripts

14 months agoremove stale script epfe.pl
Wolfram Schneider [Mon, 15 May 2023 06:22:41 +0000 (06:22 +0000)]
remove stale script epfe.pl

tools/tools/epfe/epfe.pl was a perl script that formerly generated some
printing example files from content in a very old version of the handbook.

Reported by: wblock

14 months agolinux(4): Rework signal trampoline on Aarch64
Dmitry Chagin [Sun, 14 May 2023 21:27:31 +0000 (00:27 +0300)]
linux(4): Rework signal trampoline on Aarch64

To avoid clobbering of any registers by the trampoline code use Linux
way to call signal handlers. I.e., we are out from the kernel right into
the signal handler, put return address from the signal handler into the
link register.
The mysterious NOP is required for some unwinders (e.g. libc++) that
unconditionally subtract one from the result of _Unwind_GetIP() in order
to identify the calling function.

MFC after: 1 week

14 months agolinux(4): Get rid of linux_vdso_sigcode
Dmitry Chagin [Sun, 14 May 2023 21:26:24 +0000 (00:26 +0300)]
linux(4): Get rid of linux_vdso_sigcode

MFC after: 1 week

14 months agolinux(4): Fix stack unwinding on arm64 [2/2]
Dmitry Chagin [Sun, 14 May 2023 21:25:57 +0000 (00:25 +0300)]
linux(4): Fix stack unwinding on arm64 [2/2]

To allow unwinders to go througth a previous to sigreturn frame we should
properly emulate the trampoline frame record which should points to the
previous frame and set the trampoline frame pointer to the emulated frame
before calling signal handler.

MFC after: 1 week

14 months agolinux(4): Fix stack unwinding on arm64 [1/2]
Dmitry Chagin [Sun, 14 May 2023 21:24:57 +0000 (00:24 +0300)]
linux(4): Fix stack unwinding on arm64 [1/2]

An Aarch64 sigreturn trampoline frame can't currently be described in
a DWARF .eh_frame section, because Aarch64 does not define a register
number for PC and provide no direct way to encode PC of the previous
frame. Instead, unwinders (libgcc, gdb, libunwind) detect the sigreturn
frame by looking for the sigreturn instruction. If a sigreturn frame is
detected, unwinders restores all the gprs, SP and PC by assuming that
sp points to an rt_sigframe Linux kernel struct
When entering the kernel, the link register (lr) contains the return
address of the previous frame, the exception link register (elr) contains
the address of the next instruction after the one which generated the
exception, i.e., PC.

MFC after: 1 week

14 months agoktrace: Fix syscall number on a child return path from fork
Dmitry Chagin [Sun, 14 May 2023 21:23:50 +0000 (00:23 +0300)]
ktrace: Fix syscall number on a child return path from fork

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

14 months agosys.dirdeps.mk we do want to override OBJTOP
Simon J. Gerraty [Sun, 14 May 2023 16:50:03 +0000 (09:50 -0700)]
sys.dirdeps.mk we do want to override OBJTOP

Add more comments to explain what and why.
Ensure OBJROOT ends in / or - (/ preferred).
Export OBJTOP if level > 0
this avoids the issue with bmake/unit-tests.

Check if we have to override MAKEOBJDIR
and if so, put it into env correctly.

14 months agosrc.conf.5: regen
Ed Maste [Sun, 14 May 2023 14:17:59 +0000 (10:17 -0400)]
src.conf.5: regen

Fixes: df9974197e46 ("Add description of WITH_META_ERROR_TARGET")
Fixes: 2b519b170709 ("Update description of WITH_DIRDEPS_BUILD")
Fixes: 722cfce5f494 ("Fix typo and use .Fx in WITH_DIRDEPS_BUILD")
Sponsored by: The FreeBSD Foundation

14 months agoUpdate UPDATING
Graham Perrin [Sun, 14 May 2023 13:05:05 +0000 (07:05 -0600)]
Update UPDATING

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

14 months agoCONTRIBUTING.md: minor changes
Graham Perrin [Sun, 14 May 2023 12:49:00 +0000 (06:49 -0600)]
CONTRIBUTING.md: minor changes

Fix a singular/plural mistake, spelling error, a markup error, and a
handful of other minor changes.

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

14 months agolocal.dirdeps.mk no qual for PSEUDO_MACHINE_LIST
Simon J. Gerraty [Sat, 13 May 2023 21:06:20 +0000 (14:06 -0700)]
local.dirdeps.mk no qual for PSEUDO_MACHINE_LIST

dirdeps.mk takes care of "host"
but we still need to deal with other PSEUDO_MACHINE_LIST members

14 months agoUpdate dirdeps.mk
Simon J. Gerraty [Sat, 13 May 2023 21:05:19 +0000 (14:05 -0700)]
Update dirdeps.mk

Ensure host build_dirs are not qualified.

14 months agosh: improve style
Piotr Pawel Stefaniak [Sat, 29 Apr 2023 20:42:15 +0000 (22:42 +0200)]
sh: improve style

14 months agoGENERIC: remove a stray space character
Piotr Pawel Stefaniak [Sat, 13 May 2023 19:30:28 +0000 (21:30 +0200)]
GENERIC: remove a stray space character

14 months agosys.dirdeps.mk use ?= for OBJTOP
Simon J. Gerraty [Sat, 13 May 2023 17:46:24 +0000 (10:46 -0700)]
sys.dirdeps.mk use ?= for OBJTOP

This broke bmake's after-import step.

14 months agobmake forloop test was removed
Simon J. Gerraty [Sat, 13 May 2023 17:12:08 +0000 (10:12 -0700)]
bmake forloop test was removed

14 months agoMerge bmake-20230510
Simon J. Gerraty [Sat, 13 May 2023 17:05:48 +0000 (10:05 -0700)]
Merge bmake-20230510

Merge commit '945078deae448e0a13c34b3393d836087719fb16'

14 months agoImport bmake-20230510
Simon J. Gerraty [Sat, 13 May 2023 17:03:50 +0000 (10:03 -0700)]
Import bmake-20230510

Relevant/interesting changes:

o parse.c: don't print null filename in stack traces
o for.c: skip syntactically wrong .for loops
o var.c: allow for :gmtime=${mtime}
add :mtime[=timestamp] where timestamp is used if stat(2)
fails, if :mtime=error stat(2) failure causes error.
o make.1: fix documentation of .PREFIX to match reality and POSIX
o unit-tests: improved var-scope-local

14 months agoMove MACHINE/MACHINE_ARCH handling to sys.machine.mk
Simon J. Gerraty [Sat, 13 May 2023 15:15:49 +0000 (08:15 -0700)]
Move MACHINE/MACHINE_ARCH handling to sys.machine.mk

Rather than define the TARGETS and TARGET_ARCHES in src/Makefile
put them in sys.machine.mk so they can also be leveraged by
non-top-level builds.

We have TARGET_MACHINE_LIST as the list of MACHINES we build for.

For each MACHINE we have a MACHINE_ARCH_LIST_${MACHINE}
and the first entry of each list is used as default for
MACHINE_ARCH_${MACHINE}

We can now remove a bunch of MACHINE_ARCH.* handling from
local.sys.dirdeps*mk

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

14 months agolibefi: add efi_devpath_next_instance()
Toomas Soome [Fri, 12 May 2023 15:41:14 +0000 (18:41 +0300)]
libefi: add efi_devpath_next_instance()

UEFI device path may be path to one device, or concatenated list of instances
to different devices (textually represented as comma separated list).

Provide generic function to get next instance from device path.
Returns next instance or end node.

The use case is like:

EFI_DEVICE_PATH *node = (EFI_DEVICE_PATH *)buf;
while (!IsDevicePathEnd(node)) {
process(node);
node = efi_devpath_next_instance(node);
}

Where buf is pointing to either single device path or
concatenated list of device paths (such as from ConIn or ConOut).

Reviewers: imp
Differential Revision: https://reviews.freebsd.org/D40081

14 months agorc.subr(8): delete debug cpuset helper
Enji Cooper [Thu, 11 May 2023 05:47:09 +0000 (22:47 -0700)]
rc.subr(8): delete debug cpuset helper

Summary:
The intention of the original author (I assume) was to add this logic
for testing. This removes the debug statement so it no longer shows up
in calls to `status`.

MFC after: 2 weeks
MFC with: 0661f9389

Reviewers: kevans

Subscribers: imp

Differential Revision: https://reviews.freebsd.org/D40055

14 months agoMove more DIRDEPS_BUILD settings
Simon J. Gerraty [Sat, 13 May 2023 00:40:37 +0000 (17:40 -0700)]
Move more DIRDEPS_BUILD settings

local.meta.sys.env.mk should now concern itself only with
META_MODE.

Move any DIRDEPS_BUILD settings to local.sys.dirdeps.env.mk

14 months agoMFV: xz 5.4.3.
Xin LI [Fri, 12 May 2023 22:49:34 +0000 (15:49 -0700)]
MFV: xz 5.4.3.

Relnotes: yes
MFC-after: 2 weeks

14 months agoloader: restore userboot help file
Ed Maste [Tue, 9 May 2023 13:19:42 +0000 (09:19 -0400)]
loader: restore userboot help file

Commit e32fecd0c2c3 intended to skip installing all but one copy of
each loader variant's help file, but accidentally skipped all copies for
the userboot help file.  (Other loaders install help files via the _simp
variant, but there is is no userboot_simp.)

PR: 271178
Fixes: e32fecd0c2c3 ("loader: install help files only once")
Sponsored by: The FreeBSD Foundation

14 months agoFix typo and use .Fx in WITH_DIRDEPS_BUILD
Simon J. Gerraty [Fri, 12 May 2023 16:49:03 +0000 (09:49 -0700)]
Fix typo and use .Fx in WITH_DIRDEPS_BUILD

14 months agospdx: The BSD-3-Clause-FreeBSD identifier never was, drop -FreeBSD
Warner Losh [Wed, 10 May 2023 15:40:58 +0000 (09:40 -0600)]
spdx: The BSD-3-Clause-FreeBSD identifier never was, drop -FreeBSD

There never was a BSD-3-Clause-FreeBSD SPDX identifier. Replace it
with BSD-3-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix

14 months agoSPDX: It's spelled 'SPDX-License-Identifier'
Warner Losh [Thu, 11 May 2023 16:03:59 +0000 (10:03 -0600)]
SPDX: It's spelled 'SPDX-License-Identifier'

Sponsored by: Netflix

14 months agospdx: Simplify BSD-2-Clause AND BSD-2-Clause
Warner Losh [Wed, 10 May 2023 15:40:58 +0000 (09:40 -0600)]
spdx: Simplify BSD-2-Clause AND BSD-2-Clause

After removing the -FreeBSD and -NetBSD, we're left with a nuber of
BSD-2-Clause AND BSD-2-Clause, so tidy that up.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix

14 months agospdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSD
Warner Losh [Wed, 10 May 2023 15:40:58 +0000 (09:40 -0600)]
spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSD

The SPDX folks have obsoleted the BSD-2-Clause-NetBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix

14 months agospdx: Remove duplicate lines
Warner Losh [Wed, 10 May 2023 22:42:54 +0000 (16:42 -0600)]
spdx: Remove duplicate lines

Remove duplicated SPDX lines.

Sponsored by: Netflix

14 months agospdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
Warner Losh [Wed, 10 May 2023 15:40:58 +0000 (09:40 -0600)]
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix

14 months agoUpdate description of WITH_DIRDEPS_BUILD
Simon J. Gerraty [Fri, 12 May 2023 16:42:21 +0000 (09:42 -0700)]
Update description of WITH_DIRDEPS_BUILD

14 months agoAdd description of WITH_META_ERROR_TARGET
Simon J. Gerraty [Fri, 12 May 2023 16:21:30 +0000 (09:21 -0700)]
Add description of WITH_META_ERROR_TARGET

14 months agokern.opts.mk: rationalize i386 EFI default with src.opts.mk
Ed Maste [Fri, 12 May 2023 14:39:42 +0000 (10:39 -0400)]
kern.opts.mk: rationalize i386 EFI default with src.opts.mk

PR: 269994
Fixes: ad9d10a859a ("efi: mark as broken on i386")
Sponsored by: The FreeBSD Foundation

14 months agosrc.conf.5: regen
Ed Maste [Fri, 12 May 2023 14:53:11 +0000 (10:53 -0400)]
src.conf.5: regen

Fixes: ad9d10a859ac ("efi: mark as broken on i386")
Fixes: bee3d4bf8ed5 ("Move DIRDEPS_BUILD settings to sys.dirdeps.mk")
Sponsored by: The FreeBSD Foundation

14 months agonetlink: reduce default log levels
Kristof Provost [Thu, 11 May 2023 13:08:42 +0000 (15:08 +0200)]
netlink: reduce default log levels

Reduce the default log level for netlink to LOG_INFO. This removes a
number of messages such as

> [nl_iface] dump_sa: unsupported family: 0, skipping
or
> [nl_iface] get_operstate_ether: error calling SIOCGIFMEDIA on vlan0: 22

that are useful for debugging, but not for most users.

Reviewed by: melifaro
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D40062

14 months agoath11k: import ath11k driver
Bjoern A. Zeeb [Thu, 11 May 2023 22:23:00 +0000 (22:23 +0000)]
ath11k: import ath11k driver

Import BSD-3-Clause-Clear ath11k driver assumed to be
based on Linux kvalo/ath.git master at
6bae9de622d3ef4805aba40e763eb4b0975c4f6d.

Complement the driver to make compile on FreeBSD
using LinuxKPI with changes covered by #ifdef (__FreeBSD__).
Further select updates were applied since the initial import
in order to keep compiling along with other LinuxKPI based
drivers.

Add the module build framework but keep disconnected from the
build for now.
The current driver (or rather LinuxKPI) lacks support for some
"qcom" bits needed in order to get things working.
There was interest by various people to enhance support further.

We initially only plan to support PCI parts but it would be great
to further enhance qcom SoC support to run on several (cheap) APs.

The firmware is provided by port net/wifi-firmware-ath11k-kmod.

Given the lack of full license texts on most files this is
imported under the draft policy for handling SPDX files (D29226)
and with approval for BSD-3-Clause-Clear. [1]

Approved by:    core (jhb, 2023-05-11) [1]
MFC after:      2 months

14 months agoLinuxKPI: add dummy hash.h and kernel_connect()
Bjoern A. Zeeb [Thu, 11 May 2023 22:19:57 +0000 (22:19 +0000)]
LinuxKPI: add dummy hash.h and kernel_connect()

Add crypto/hash.h and a dummy kernel_connect() needed to compile
the ath11k wireless driver.  While I hope we will not actually need
the hash.h fallbacks, kernel_connect() we will have to deal with once
we sort out more QMI bits.

MFC after: 10 days

14 months agoamd64: pmap.h put a guard around a pcpu.h function
Bjoern A. Zeeb [Fri, 12 May 2023 11:14:54 +0000 (11:14 +0000)]
amd64: pmap.h put a guard around a pcpu.h function

pmap_get_pcid() calls zpcpu_get() which is defined in pcpu.h.
It is unclear why we do not include that header but like right
above the change add another guard around pmap_get_pcid().
This allows some LinuxKPI headers to compile again.

Suggested by: markj
MFC after: 10 days

14 months agozfs: merge openzfs/zfs@e61076683
Martin Matuska [Fri, 12 May 2023 11:12:59 +0000 (13:12 +0200)]
zfs: merge openzfs/zfs@e61076683

Notable upstream pull request merges:
  #14744 Optimize check_filesystem() and process_error_log()
  #14773 Allow zhack label repair to restore detached devices
  #14794 zpool import -m also removing spare and cache when log device
         is missing
  #14805 Simplify and optimize random_int_between()
  #14813 Enable the head_errlog feature to remove errors
  #14816 Fix two abd_gang_add_gang() issues
  #14817 Verify block pointers before writing them out
  #14819 Add dmu_tx_hold_append() interface
  #14823 Remove single parent assertion from zio_nowait()
  #14824 Plug memory leak in zfsdev_state
  #14825 Block cloning dbuf fixes
  #14828 Remove duplicate code in l2arc_evict()
  #14837 Fixes in head_errlog feature with encryption
  #14839 Prevent panic during concurrent snapshot rollback and zvol read
  #14853 zil: Don't expect zio_shrink() to succeed

Obtained from: OpenZFS
OpenZFS commit: e6107668385044718b0a73330ed6423650806473

14 months agovlan: fix setting flags on a QinQ interface
Kristof Provost [Fri, 12 May 2023 08:42:48 +0000 (10:42 +0200)]
vlan: fix setting flags on a QinQ interface

Setting vlan flags needlessly takes the exclusive VLAN_XLOCK().

If we have stacked vlan devices (i.e. QinQ) and we set vlan flags (e.g.
IFF_PROMISC) we call rtnl_handle_ifevent() to send a notification about
the interface.
This ends up calling SIOCGIFMEDIA, which requires the VLAN_SLOCK().
Trying to take that one with the VLAN_XLOCK() held deadlocks us.

There's no need for the exclusive lock though, as we're only accessing
parent/trunk information, not modifying it, so a shared lock is
sufficient.

While here also add a test case for this issue.

Backtrace:
shared lock of (sx) vlan_sx @ /usr/src/sys/net/if_vlan.c:2192
while exclusively locked from /usr/src/sys/net/if_vlan.c:2307
panic: excl->share
cpuid = 29
time = 1683873033
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe015d4ad4b0
vpanic() at vpanic+0x152/frame 0xfffffe015d4ad500
panic() at panic+0x43/frame 0xfffffe015d4ad560
witness_checkorder() at witness_checkorder+0xcb5/frame 0xfffffe015d4ad720
_sx_slock_int() at _sx_slock_int+0x67/frame 0xfffffe015d4ad760
vlan_ioctl() at vlan_ioctl+0xf8/frame 0xfffffe015d4ad7c0
dump_iface() at dump_iface+0x12f/frame 0xfffffe015d4ad840
rtnl_handle_ifevent() at rtnl_handle_ifevent+0xab/frame 0xfffffe015d4ad8c0
if_setflag() at if_setflag+0xf6/frame 0xfffffe015d4ad930
ifpromisc() at ifpromisc+0x2a/frame 0xfffffe015d4ad960
vlan_setflags() at vlan_setflags+0x60/frame 0xfffffe015d4ad990
vlan_ioctl() at vlan_ioctl+0x216/frame 0xfffffe015d4ad9f0
if_setflag() at if_setflag+0xe4/frame 0xfffffe015d4ada60
ifpromisc() at ifpromisc+0x2a/frame 0xfffffe015d4ada90
bridge_ioctl_add() at bridge_ioctl_add+0x499/frame 0xfffffe015d4adb10
bridge_ioctl() at bridge_ioctl+0x328/frame 0xfffffe015d4adbc0
ifioctl() at ifioctl+0x972/frame 0xfffffe015d4adcc0
kern_ioctl() at kern_ioctl+0x1fe/frame 0xfffffe015d4add30
sys_ioctl() at sys_ioctl+0x154/frame 0xfffffe015d4ade00
amd64_syscall() at amd64_syscall+0x140/frame 0xfffffe015d4adf30
fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfffffe015d4adf30
--- syscall (54, FreeBSD ELF64, ioctl), rip = 0x22b0f0ef8d8a, rsp = 0x22b0ec63f2c8, rbp = 0x22b0ec63f380 ---
KDB: enter: panic
[ thread pid 5715 tid 101132 ]

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

14 months agoarm64: Fix a typo in a source code comment
Gordon Bergling [Fri, 12 May 2023 08:45:46 +0000 (10:45 +0200)]
arm64: Fix a typo in a source code comment

- s/inferface/interface/

MFC after: 3 days

14 months agobhyve: import OpRegion definitions
Corvin Köhne [Wed, 10 May 2023 10:25:19 +0000 (12:25 +0200)]
bhyve: import OpRegion definitions

Those definitions are required for the GVT-d emulation to parse the
OpRegion.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D40037

14 months agobhyve: add helper for passthru specific mmio ranges
Corvin Köhne [Wed, 10 May 2023 10:22:33 +0000 (12:22 +0200)]
bhyve: add helper for passthru specific mmio ranges

Intel GPUs have two special memory regions. They are called Graphics
Stolen Memory and OpRegion. bhyve has to emulate both of them. In order
to keep track of those special regions, add generic mmio ranges to the
passthru emulation.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D40036

14 months agobhyve: don't panic if e820 finds no available memory
Corvin Köhne [Tue, 9 May 2023 12:32:33 +0000 (14:32 +0200)]
bhyve: don't panic if e820 finds no available memory

The GVT-d emulation tries to allocate some specific memory. It could
happen that this address doesn't exist. In that case, GVT-d will fall
back to allocate any address. Nevertheless, this only works if the e820
fails with an error instead of exiting on an assertion.

Reviewed by: markj
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG
Differential Revision: https://reviews.freebsd.org/D40034

14 months agoVendor import of xz 5.4.3 (trimmed)
Xin LI [Fri, 12 May 2023 06:31:50 +0000 (23:31 -0700)]
Vendor import of xz 5.4.3 (trimmed)

14 months agoMove DIRDEPS_BUILD settings to sys.dirdeps.mk
Simon J. Gerraty [Thu, 11 May 2023 23:15:04 +0000 (16:15 -0700)]
Move DIRDEPS_BUILD settings to sys.dirdeps.mk

When originally implemented, there was no distinction between
DIRDEPS_BUILD and META_MODE, they were one and the same.

META_MODE however is useful by itself, but since meta.sys.mk
had lots of settings related to DIRDEPS_BUILD its use was limited
to DIRDEPS_BUILD.

Move (most) DIRDEPS_BUILD related items to sys.dirdeps.mk
so that meta.sys.mk can be used for just META_MODE.
There is of course some bluring of the lines, so settings remain
in meta.sys.mk

Add MK_META_ERROR_TARGET to enable the META_MODE .ERROR target
independent of DIRDEPS_BUILD, it copies failed .meta files to ${SB}/error
to make it easier to identify the cause of build failures.

Since sys.dirdeps.mk should be included first, most of
local.meta.sys.mk becomes local.sys.dirdeps.mk
and some other bits need to move to local.sys.dirdeps.env.mk

Also fix dirdeps.mk to not add CURDIR to DIRDEPS when it is SRCTOP.

Reviewed by: bdrewery
Differential Revision: https://reviews.freebsd.org/D40053

14 months agoMake sure we are not trying to clone a spill block.
Pawel Jakub Dawidek [Wed, 10 May 2023 05:32:30 +0000 (22:32 -0700)]
Make sure we are not trying to clone a spill block.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Closes #14825

14 months agoCorrect comment.
Pawel Jakub Dawidek [Thu, 4 May 2023 23:14:19 +0000 (16:14 -0700)]
Correct comment.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Closes #14825

14 months agoRemove badly placed comment.
Pawel Jakub Dawidek [Thu, 4 May 2023 06:25:22 +0000 (23:25 -0700)]
Remove badly placed comment.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Closes #14825

14 months agoDon't call zfs_exit_two() before zfs_enter_two().
Pawel Jakub Dawidek [Wed, 3 May 2023 07:24:47 +0000 (00:24 -0700)]
Don't call zfs_exit_two() before zfs_enter_two().

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Closes #14825

14 months agoDon't use dmu_buf_is_dirty() for unassigned transaction.
Pawel Jakub Dawidek [Tue, 2 May 2023 22:46:14 +0000 (15:46 -0700)]
Don't use dmu_buf_is_dirty() for unassigned transaction.

The dmu_buf_is_dirty() call doesn't make sense here for two reasons:
1. txg is 0 for unassigned tx, so it was a no-op.
2. It is equivalent of checking if we have dirty records and we are doing
   this few lines earlier.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Closes #14825

14 months agoDeny block cloning is dbuf size doesn't match BP size.
Pawel Jakub Dawidek [Tue, 2 May 2023 21:24:43 +0000 (14:24 -0700)]
Deny block cloning is dbuf size doesn't match BP size.

I don't know an easy way to shrink down dbuf size, so just deny block cloning
into dbufs that don't match our BP's size.

This fixes the following situation:
1. Create a small file, eg. 1kB of random bytes. Its dbuf will be 1kB.
2. Create a larger file, eg. 2kB of random bytes. Its dbuf will be 2kB.
3. Truncate the large file to 0. Its dbuf will remain 2kB.
4. Clone the small file into the large file. Small file's BP lsize is
   1kB, but the large file's dbuf is 2kB.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Closes #14825

14 months agoAdditional block cloning fixes.
Pawel Jakub Dawidek [Sun, 30 Apr 2023 09:47:09 +0000 (02:47 -0700)]
Additional block cloning fixes.

Reimplement some of the block cloning vs dbuf logic, mostly to fix
situation where we clone a block and in the same transaction group
we want to partially overwrite the clone.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pawel Jakub Dawidek <pawel@dawidek.net>
Closes #14825

14 months agodma: specify OpenSSL 1.1 API
Pierre Pronchery [Tue, 9 May 2023 14:06:40 +0000 (16:06 +0200)]
dma: specify OpenSSL 1.1 API

Reviewed by: emaste
Sponsored by: The FreeBSD Foundation

14 months agodma: use OpenSSL 1.1 init API
Ed Maste [Thu, 11 May 2023 14:44:05 +0000 (10:44 -0400)]
dma: use OpenSSL 1.1 init API

> The SSL_library_init() and OpenSSL_add_ssl_algorithms() functions were
> deprecated in OpenSSL 1.1.0 by OPENSSL_init_ssl().

and

> The ERR_load_crypto_strings(), SSL_load_error_strings(), and
> ERR_free_strings() functions were deprecated in OpenSSL 1.1.0 by
> OPENSSL_init_crypto() and OPENSSL_init_ssl() and should not be used.

Reviewed by: ngie
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40065

14 months agoLinuxKPI: 802.11: fix IEEE80211_TX_INFO_DRIVER_DATA_SIZE
Bjoern A. Zeeb [Thu, 11 May 2023 21:35:11 +0000 (21:35 +0000)]
LinuxKPI: 802.11: fix IEEE80211_TX_INFO_DRIVER_DATA_SIZE

Fix the sizing of IEEE80211_TX_INFO_DRIVER_DATA_SIZE so that it
also works on 32bit platforms.  Otherwise it triggers a compile-time
assertion in ath10k for i386.

Sponsored by: The FreeBSD Foundation
MFC after: 10 days

14 months agozil: Don't expect zio_shrink() to succeed.
Alexander Motin [Thu, 11 May 2023 21:27:12 +0000 (17:27 -0400)]
zil: Don't expect zio_shrink() to succeed.

At least for RAIDZ zio_shrink() does not reduce zio size, but reduced
wsz in that case likely results in writing uninitialized memory.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by:   iXsystems, Inc.
Closes #14853

14 months agorc.conf.5: document name_cpuset, introduced in rev 0661f93892a2
Ceri Davies [Thu, 11 May 2023 21:06:56 +0000 (22:06 +0100)]
rc.conf.5: document name_cpuset, introduced in rev 0661f93892a2

14 months agostand/efi: Retire i386 support
Warner Losh [Thu, 11 May 2023 20:04:12 +0000 (14:04 -0600)]
stand/efi: Retire i386 support

Remove the i386 ifdefs and files. It never worked.

Sponsored by: Netflix
Reviewed by: manu, tsoome, kevans
Differential Revision: https://reviews.freebsd.org/D40012

14 months agoefi: mark as broken on i386
Warner Losh [Thu, 11 May 2023 20:04:05 +0000 (14:04 -0600)]
efi: mark as broken on i386

We're never going to support EFI booting on i386 (32-bit). Start to
decommission it, since it's never worked.

Sponsored by: Netflix
Reviewed by: tsoome, emaste
Differential Revision: https://reviews.freebsd.org/D40011

14 months agostand: eficom: Only set baudrate when it changes
Warner Losh [Thu, 11 May 2023 20:04:00 +0000 (14:04 -0600)]
stand: eficom: Only set baudrate when it changes

Only set the baudrate when it is different than what the device has
reported. In addition, pass in the args to effect no change to the other
parameters to the serial port. Some EFI firmware gets cranky when you
set them to the same value, so avoid doing so (we likely can remove the
HyperV workaround with this fix, but I kept it in place). Add comments
to the code for why we do this too.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D40010

14 months agostand: eficom: Don't preemtively assume flow control
Warner Losh [Thu, 11 May 2023 20:03:51 +0000 (14:03 -0600)]
stand: eficom: Don't preemtively assume flow control

Remove rtsdtr_off. It's basically unused. Expand its meaning, but put
changing flow control to under an ifdef. We shouldn't set it unless
we're sure we need to do so. UEFI normally initializes the device
correctly, and we should avoid needless changes that aren't user
requested.

Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D40009

14 months agostand: eficom : remove unused ignore_cd
Warner Losh [Thu, 11 May 2023 20:03:47 +0000 (14:03 -0600)]
stand: eficom : remove unused ignore_cd

Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D40008

14 months agostand: Move eficom to libefi
Warner Losh [Thu, 11 May 2023 20:03:42 +0000 (14:03 -0600)]
stand: Move eficom to libefi

Rename efiserialc to eficom.c and move it to libefi. Remove
loader.efi.h, since it's not needed. It's architecture independent
(though how we use it might vary). Drivers also belong in libfoo
in the boot loader: all the BIOS drivers are in i386/libi386 and
the console driver is in efi/libefi.

Sponsored by: Netflix
Reviewed by: tsoome
Differential Revision: https://reviews.freebsd.org/D40007

14 months agostand: Make non-matching console names OKer
Warner Losh [Thu, 11 May 2023 20:03:37 +0000 (14:03 -0600)]
stand: Make non-matching console names OKer

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D39984

14 months agostand: add comconsole backwards compatibility shim for aarch64
Warner Losh [Thu, 11 May 2023 20:03:30 +0000 (14:03 -0600)]
stand: add comconsole backwards compatibility shim for aarch64

Add a compat shim for the "comconsole" name so that people with a
"console=comconsole" in their loader.conf on aarch64 will continue to
work (though with a warning).

This is only aarch64: it will never be there for amd64 (where comconsole
always means talk to the hardware directly). To do that is too hard.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D39983

14 months agostand: efi create eficom console device.
Warner Losh [Thu, 11 May 2023 20:03:17 +0000 (14:03 -0600)]
stand: efi create eficom console device.

Fix the 'renaming kludge' that we absolutely cannot do going forward
(it's cost us days of engineering time).

console=comconsole talks to the hardware directly. This is available
only on amd64. It is not available anywhere else (and so requires
changes for people doing comconsole on aarch64)

console=eficom talks to the console via EFI protocols.  It's available
on amd64, aarch64 and riscv64. It's the first port that we find, though
it can be overriden by efi_com_port (which should be set to the UID of
the serial port, not the I/O port, despite the name). devinfo -v
will give the UID to uartX mapping.

This is an incompatible change for HYPER-V on amd64. It only works with
eficom console, so you'll need to change your configuration in
loader.conf. No compatibility hack will ever be provided for this (since
it requires renamig, which the loader cannot reliably do).

It's also an incompatible change for aarch64. comconsole will need to
change to eficom. There might be a comconsole "shim" for this.

All the interlock to keep only eficom and comconsole from both attaching
have been removed.

RelNotes: Yes
Sponsored by: Netflix
Discussed with: kevans
Differential Revision: https://reviews.freebsd.org/D39982

14 months agoarm64: add swapueword8/32
Kyle Evans [Thu, 11 May 2023 18:23:03 +0000 (13:23 -0500)]
arm64: add swapueword8/32

Much like casueword*, except just a plain old swap.  Maintains a similar
interface to casu(9)- return value -1 (fault), 0 (success), or 1 (fail),
and also both ll/sc and LSE variants are implemented.

These will be used to implement 32-bit swp/swpb emulation on aarch64.

Reveiwed by: andrew
Sponsored by: Stormshield
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D39837

14 months agoCirrus-CI: hide manual tasks from official runs
Ed Maste [Thu, 11 May 2023 15:16:51 +0000 (11:16 -0400)]
Cirrus-CI: hide manual tasks from official runs

Sponsored by: The FreeBSD Foundation

14 months agofbt/x86: update FBT_AFRAMES to match the trap handlers
Chuck Silvers [Thu, 11 May 2023 01:22:15 +0000 (18:22 -0700)]
fbt/x86: update FBT_AFRAMES to match the trap handlers

Reviewed by: markj
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D40054