Commit Graph

283646 Commits

Author SHA1 Message Date
Bjoern A. Zeeb
910a834383 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
2023-05-11 21:36:59 +00:00
Ceri Davies
620b5bfaef rc.conf.5: document name_cpuset, introduced in rev 0661f93892 2023-05-11 22:06:56 +01:00
Warner Losh
c16e08e5f3 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
2023-05-11 14:06:03 -06:00
Warner Losh
ad9d10a859 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
2023-05-11 14:06:03 -06:00
Warner Losh
8c3d6917c1 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
2023-05-11 14:06:03 -06:00
Warner Losh
cb2da74905 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
2023-05-11 14:06:03 -06:00
Warner Losh
66826fd54a stand: eficom : remove unused ignore_cd
Sponsored by:		Netflix
Reviewed by:	tsoome
Differential Revision:	https://reviews.freebsd.org/D40008
2023-05-11 14:06:03 -06:00
Warner Losh
bab80c12a8 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
2023-05-11 14:06:03 -06:00
Warner Losh
82cf061eba stand: Make non-matching console names OKer
Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D39984
2023-05-11 14:06:03 -06:00
Warner Losh
f93416d677 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
2023-05-11 14:06:03 -06:00
Warner Losh
2f131435bc 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
2023-05-11 14:06:03 -06:00
Kyle Evans
86c31aca33 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
2023-05-11 13:23:14 -05:00
Ed Maste
9244506a1b Cirrus-CI: hide manual tasks from official runs
Sponsored by:	The FreeBSD Foundation
2023-05-11 14:20:43 -04:00
Chuck Silvers
9095169520 fbt/x86: update FBT_AFRAMES to match the trap handlers
Reviewed by:	markj
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D40054
2023-05-11 10:50:15 -07:00
Dmitry Salychev
718bdb6a71
dpaa2: Simplify addresses translation with PHYS_TO_DMAP
Approved by:		bz (mentor)
Reviewed by:		bz (mentor), mhorne
Differential Revision:	https://reviews.freebsd.org/D39946
MFC after:		3 weeks
2023-05-11 17:38:35 +02:00
Pierre Pronchery
74192f9b2d ktls_test: specify OpenSSL 1.1 API
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
2023-05-11 10:30:51 -04:00
Corvin Köhne
60793cee27
bhyve: make passthru sel public available
The GVT-d emulation requires access to this selector to read from the
device.

Reviewed by:		markj
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D40035
2023-05-11 14:30:19 +02:00
Corvin Köhne
ca14781c81
bhyve: add cmdline option for user defined fw_cfg items
Some guest allow to configure themself by fw_cfg. E.g. Fedora CoreOs can
be provisioned by adding a JSON file as fw_cfg item.

Reviewed by:		jhb
MFC after:		1 week
Sponsored by:		Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D38338
2023-05-11 14:20:32 +02:00
Li-Wen Hsu
fec7422037
Complete removing twe(4)
Fixes:	062a7b918f twe: Remove driver
2023-05-11 16:28:23 +08:00
Kristof Provost
0229fab2fe e1000: fix VLAN 0
VLAN 0 essentially means "Treat as untagged, but with priority bits",
and is used by some ISPs.

On igb/em interfaces we did not receive packets with VLAN tag 0 unless
vlanhwfilter was disabled.

This can be fixed by explicitly listing VLAN 0 in the hardware VLAN
filter (VFTA). Do this from em_setup_vlan_hw_support(), where we already
(re-)write the VFTA.

Reviewed by:	kbowling
Sponsored by:   Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D40046
2023-05-11 09:48:50 +02:00
Dag-Erling Smørgrav
27e74c8fff md5: Add missing <errno.h>.
Sponsored by:	Klara, Inc.
Reviewed by:	yuripv
Differential Revision:	https://reviews.freebsd.org/D40051
2023-05-11 06:24:02 +00:00
Enji Cooper
4e9041a786 rc.subr(8): run trailing-whitespace-fixer
This change deletes benign trailing whitespace from rc.subr, making
future non-stylistic changes easier to spot.

MFC after:	1 week
2023-05-10 22:39:32 -07:00
Miroslav Lachman
0661f93892 rc: add support for cpuset(1)
If ${name}_cpuset is specified (and /usr is mounted), cpuset(1) will be
run to limit the service to the configured cpuset.

PR:		142434
Reviewed by:	kevans
2023-05-10 23:40:18 -05:00
Warner Losh
062a7b918f twe: Remove driver
Sponsored by:		Netflix
2023-05-10 22:24:12 -06:00
Kyle Evans
3cb2f5f369 lualoader: add support for .lua configuration files
If a file is specified in loader_conf_files that ends in '.lua', lualoader
will now load and execute that file. These may be used in place of a
traditional loader.conf to use more complicated logic, where some values
may be set based on others or based on the environment that the C bits has
left us with.

Lua scripts are run in a limited environment. In particular, it does not get
access to any modules or, in-fact, anything except environment variable.

A config.buildenv hook has been added so that a local module can add
whatever it may need to to the environment.

When a global var is set in the lua script, it does not immediately alter
the loader environment. Instead, the script's environment is initially
empty and processed only if the whole script executes successfully.
Effectively, a lua configuration file either takes effect or it does not,
an error will not leave it in a half-baked state.

Reviewed by:	bcr (manpages), imp
Differential Revision:	https://reviews.freebsd.org/D28450
2023-05-10 23:10:53 -05:00
Konstantin Belousov
b6d3a9644d net/pfkeyv2.h: fix typo, meNber
Sponsored by:	NVidia networking
MFC after:	3 days
2023-05-11 02:52:39 +03:00
Ed Maste
3d6a94db10 Install spleen vt(4) fonts
From https://github.com/fcambus/spleen, imported into contrib in
0d66206fff.

Reviewed by:	Frederic Cambus
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D20654
2023-05-10 13:57:07 -04:00
Dag-Erling Smørgrav
09aee57098 tsort: Add unit tests.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D40043
2023-05-10 15:45:44 +02:00
Dag-Erling Smørgrav
b55bc49e86 tsort: Replace bcopy() with memcpy().
Also fix an indentation error I introduced in the previous commit.

Fixes:		cb46f47c79
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D40042
2023-05-10 15:45:38 +02:00
Dag-Erling Smørgrav
00de65aaed md5: Add missing references to sha384.
Fixes:		4849767cb1
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D40032
2023-05-10 15:45:11 +02:00
Mitchell Horne
031049cf32 hier(7): fix a couple mandoc warnings
These references are rendered correctly without the zero-width space.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2023-05-10 10:26:35 -03:00
Mitchell Horne
36db6b0496 hier(7): document /home/ and /usr/home/
Reviewed by:	imp
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40002
2023-05-10 10:25:17 -03:00
Mitchell Horne
1bc55f5839 hier(7): drop list of /usr/share/doc subdirectories
Several entries are outdated, several new ones are missing. I do not
think there is much value added in maintaining this.

Reviewed by:	imp, emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40001
2023-05-10 10:18:21 -03:00
Mitchell Horne
c3b611e153 hier(7): drop list of /usr/include subdirectories
It is nice to have, however, the location of this information means that
it will naturally be missed by developers adding or removing directories
to the layout, so it trends out-of-date and it is out-of-date.

The target audience for hier(7) is users and administrators. It is not
expected to be a place that programmers should go to learn about the
purposes of the different C headers provided by FreeBSD.

Program authors needing FreeBSD-specific interfaces or libraries
(#include <sys/queue.h>, for instance) will either be following a more
detailed man page, or consulting the header contents directly. Folks
targeting standardized headers (#include <sys/time.h>) will not need
hier(7) to tell them where those headers are under /usr/include.

In other words, this is more detail than necessary for this document.
I'd go as far as to say that many of the existing entries in this list
do little more than parrot the name of the directory.

With all this in mind, let's drop the maintenance burden.

Reviewed by:	imp, emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40000
2023-05-10 10:17:41 -03:00
Alexander V. Chernikov
444b9aa78c ifconfig: fix family selection after 982cd5ae8e 2023-05-10 12:40:51 +00:00
Alexander V. Chernikov
a3cb80bc63 ifconfig: fix interface selection after 982cd5ae8e. 2023-05-10 12:22:39 +00:00
Zachary Leaf
2b8c4137d4 arm64: fix stack unwinding past exception handlers
Commit 281402e0a5 ("arm64: Shave off two instructions in exceptions")
removed the instruction that set the frame pointer (x29) as it appeared
to be unused.

The frame pointer is used in arm64/db_trace.c:db_stack_trace_cmd() when
unwinding state, and hence still needs to be set.

Add back the instruction to save_registers to properly update frame
pointer.

Reported by: andrew
Sponsored by: Arm Ltd
2023-05-10 12:54:54 +01:00
Alexander V. Chernikov
982cd5ae8e ifconfig: split argument parsing and actual execution logic
Reduce the amount of global variables by creating the dedicated
 ifconfig_args structure and use it as a context-passing variable.
Simplify the code by moving all argument preparation code a
 separate function.

Reviewed by: kp (previous version)
Differential Revision: https://reviews.freebsd.org/D39932
MFC after:	2 weeks
2023-05-10 10:39:12 +00:00
Alexander V. Chernikov
3c851dc19b netlink: provide original interface lladdr in the interface dump.
* Store lladdr in the FreeBSD-specific IFLAF_ORIG_HWADDR attr
* Do not export empty IFLA_ADDRESS for interfaces w/o lladdrs.

MFC after:	2 weeks
2023-05-10 09:57:01 +00:00
Alexander V. Chernikov
30d0fc6f33 netlink: export more IPv6 ifa info
* Fill in IFA_CACHEINFO with prefix lifetime data
* Map IPv6 IN6_IFF_ flags to Netlink IFA_F_ flags
* Store original ia6_flags in the FreeBSD-specific IFAF_FLAGS field

MFC after:	2 weeks
2023-05-10 09:57:01 +00:00
Alexander V. Chernikov
1224878016 netlink: export carp VHID when dumping interface addresses.
MFC after:	2 weeks
2023-05-10 09:57:01 +00:00
Dag-Erling Smørgrav
facc213643 md5: Don't increment a bool.
Fixes:		4849767cb1
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D40020
2023-05-10 09:25:21 +00:00
Dag-Erling Smørgrav
90eaf4b2f9 md5: Include <osreldate.h> for __FreeBSD_version.
It is usually provided by <sys/param.h>, but not when bootstrapping.

Fixes:		4849767cb1
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	yuripv, kevans
Differential Revision:	https://reviews.freebsd.org/D40018
2023-05-10 09:25:21 +00:00
Dag-Erling Smørgrav
f1ceb05a46 md5: Fix input error check.
Fixes:		4849767cb1
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	tsoome, kevans, lwhsu
Differential Revision:	https://reviews.freebsd.org/D40017
2023-05-10 09:25:21 +00:00
Ed Maste
0e04dd3b66 pkgbase: report error if files are installed multiple times
Files installed by `make installworld` should be installed only once.

PR:		244596
Sponsored by:	The FreeBSD Foundation
2023-05-09 21:10:03 -04:00
Ed Maste
b6271cc0d0 includes: avoid installing if_wg.h twice
if_wg.h was installed via dev/wg in LSUBDIRS and also explicitly.  We
want to install only wg/if_wg.h not the other headers, so add dev/wg to
the skip list in the copies and symlinks targets.

PR:		271266
Reviewed by:	kevans
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40031
2023-05-09 21:09:39 -04:00
Ed Maste
e32fecd0c2 loader: install help files only once
Every file should be installed exactly once by `make installworld`.
This is especially important for pkgbase.

Loader help files were being installed by each loader variant (e.g.,
the simp, lua, and 4th EFI loaders).  Add a (slightly hacky) mechanism
to skip installing help files for all but one variant.

PR:		271178
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40021
2023-05-09 20:18:19 -04:00
Colin Percival
c55b7e5226 freebsd-update: Fix merging already-updated files
When performing an "upgrade" (moving between FreeBSD releases, as
opposed to "update" which merely applies security/errata updates
to the installed release) FreeBSD Update:

1. Generates a list of "files needing to be merged", namely those
files which don't match the version installed in the "old" release
and have paths matching the MergeChanges configuration directive
(by default, /boot/device.hints and everything under /etc/).

and later on,

2. Compares the currently-installed files to the versions in the
"new" release, removing index entries for files which "don't need
to be updated because they're not changing".

Unfortunately if a file falls into both of these categories -- that
is to say, if a file in /etc/ is the same as the version in the new
release and not the same as the version in the old release -- the
resulting "merge" step saw that the file was no longer listed as
being part of the new release, resulting in the file being deleted.

For the first 18 years of FreeBSD Update's existence, this never
happened, since $FreeBSD$ tags resulted in "new release" files
always being different from any files systems would already have
installed.

This commit fixes this behaviour by only placing a file into the
"files needing to be merged" list if it does not match the version
in the old release *or* the version in the new release.

Reported by:	des
Reviewed by:	delphij (earlier version), des, emaste
MFC after:	7 days
X-EN-Candidate:	yes
Differential Revision:	https://reviews.freebsd.org/D39973
2023-05-09 16:28:09 -07:00
Ed Maste
f5f1b9a982 Cirrus-CI: add gcc12 automatic task on primary GitHub mirror
We want to get GCC coverage via Cirrus-CI, but don't want to trigger
excessive runs across all forks and branches.  Create a duplicate gcc12
task to run automatically for freebsd/freebsd-src.

Reviewed by:	jhb
Sponsored by:	The FreeBSD Foundation
2023-05-09 17:13:44 -04:00
Kirk McKusick
b3fe5d9322 Fix off-by-one error in fsck_ffs(8) chkrange() block-number check.
On an amd64-CURRENT machine with an i-node that refers to a block
number that is one too large will cause a core dump, due to writing
beyond the end of blockmap[] and corrupting the next heap block,
which happens to contain a struct inoinfo in inphash[]. Note that
valgrind catches the blockmap[] access.

Reported by:  Robert Morris
PR:           271289
MFC after:    1 week
Sponsored by: The FreeBSD Foundation
2023-05-09 13:08:10 -07:00