]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
4 months agox86/xen: do video console fixup as part of early initialization
Roger Pau Monné [Fri, 2 Feb 2024 10:29:57 +0000 (11:29 +0100)]
x86/xen: do video console fixup as part of early initialization

When FreeBSD is running as dom0 the video console metadata provided by the
bootloader might not be accurate, as Xen has very likely taken over the console
and possibly changed the mode.

Adjust the video console information in the kernel metadata as part of early
Xen initialization.

Sponsored by: Cloud Software Group
Reviewed by: imp
Differential revision: https://reviews.freebsd.org/D43934

4 months agox86/xen: move shared page setup to early init handler
Roger Pau Monné [Fri, 2 Feb 2024 10:20:33 +0000 (11:20 +0100)]
x86/xen: move shared page setup to early init handler

As done with the hypercall page, move the setup fo the shared info page into
the newly introduced helper, which the aim of having a single helper and call
site used by both HVM and PV in order to setup the basic Xen environment.

Sponsored by: Cloud Software Group
Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D43933

4 months agox86/xen: introduce a Xen early init function
Roger Pau Monné [Fri, 2 Feb 2024 10:00:31 +0000 (11:00 +0100)]
x86/xen: introduce a Xen early init function

Start by moving the hyeprcall setup to such function.

The aim is to have a function that does all the required Xen early
initialization for both HVM and PVH, instead of having it scattered across
different paths.

Sponsored by: Cloud Software Group
Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D43932

4 months agox86/xen: remove parameter from fixup_console()
Roger Pau Monné [Fri, 2 Feb 2024 08:32:15 +0000 (09:32 +0100)]
x86/xen: remove parameter from fixup_console()

And instead fetch the metadata inside of the function.

This is done in preparation for changing the call site of fixup_console(),
which will no longer have the kernel metedata pointer in context.

No functional change intended.

Sponsored by: Cloud Software Group
Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D43931

4 months agox86/xen: fill hypercall page with int3
Roger Pau Monné [Fri, 2 Feb 2024 08:50:16 +0000 (09:50 +0100)]
x86/xen: fill hypercall page with int3

Filling the hypercall page with nops is not helpful from a debugging point of
view, as for example attempting to execute an hypercall before the page is
initialized will result in the execution flow falling through into
xen_start32, making the mistake less obvious to spot.

Instead fill the page with int3 (0xcc) which will result in a #BP trap.

Sponsored by: Cloud Software Group
Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D43930

4 months agox86/cpu: improve hypervisor detection
Roger Pau Monné [Fri, 19 Jan 2024 09:15:17 +0000 (10:15 +0100)]
x86/cpu: improve hypervisor detection

Some hypervisors can expose multiple signatures, for example Xen will expose
both the Xen and the HyperV signatures if Viridian extensions are enabled for
the guest.  Presence of multiple signatures is currently not handled by
FreeBSD, that will exit once a known signature is found in cpuid output.

Exposing the HyperV signature on hypervisors different than HyperV is not
uncommon, this is done so that such hypervisor can expose a (subset) of the
Viridian extensions to Windows guests for performance reasons.  Likely for
compatibility purposes the HyperV signature is always exposed on the first
leaf, and the Xen signature is exposed in the secondary leaf.

Fix the specific case of HyperV by not exiting from the scan if the HyperV
signature is found, and prefer a second signature if one is found.

Note that long term we might wish to convert vm_guest into a bitmap, so that it
can signal detection of multiple hypervisor interfaces.

Fixes: b0165dc4539f ('x86/xen: fix HVM guest hypercall page setup')
PR: 276421
Sponsored by: Cloud Software Group
Reviewed by: markj kib
Differential revision: https://reviews.freebsd.org/D43508

4 months agox86/xen: introduce non-hypercall based emergency print
Roger Pau Monné [Mon, 22 Jan 2024 13:20:25 +0000 (14:20 +0100)]
x86/xen: introduce non-hypercall based emergency print

The current xc_printf() function uses an hypercall in order to send character
buffers to the hypervisor for it to print on the hypervisor console (if the
hypervisor is configured to print such messages).

This requires the hypercall page to be initialized, which is extra work and can
go wrong.

On x86 instead of using the console IO hypercall use the debug console IO port,
also called "port E9 hack".  This allows sending characters to Xen using an
outb instruction, without any initialization required.

Keep the previous hypervisor based implementation by using the weak attribute,
which allows each architecture to provide an alternate (arch-specific)
implementation.

Sponsored by: Cloud Software Group
Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D43929

4 months agox86/xen: fix out of bounds access to the event channel masks on resume
Roger Pau Monné [Mon, 5 Feb 2024 10:47:25 +0000 (11:47 +0100)]
x86/xen: fix out of bounds access to the event channel masks on resume

When resuming from migration or suspension all regular event channels ports are
reset to the INVALID_EVTCHN value, and drivers should re-initialize them
according to the new value provided by the other end of the connection.

However, the driver would first attempt to unbind the event channel handler
before attempting to bind it using the newly provided port.  This unbind uses
the stale event channel port that has been set to INVALID_EVTCHN for some
operations (notably as a result of the handler removal the interrupt subsystem
ends up calling disable intr and source PIC hooks).

This was fine when INVALID_EVTCHN was 0, as then the operation would just
result in pointless setting of the 0 bit in the different event channel related
control arrays (evtchn_{pending,mask} for example).  However with the change to
define INVALID_EVTCHN as ~0 the write is no longer pointless, and we end up
triggering a page-fault, or corrupting random data that happens to be mapped at
the array position + ~0 bits.

In hindsight the change of INVALID_EVTCHN from 0 to ~0 was way more risky than
initially assessed, and I believe has end up resulting in more fragile code for
no real benefit.

Fix the disable intr and source wrappers to check whether the event channel is
valid before attempting to use it.

Also introduce some extra KASSERTs in several array accesses in order to avoid
out of bounds accesses if INVALID_EVTCHN ever reaches those functions.

Fixes: 1797ff962769 ('xen/intr: cleanup event channel number use')
MFC after: 1 week
Sponsored by: Cloud Software Group
Reviewed by: markj
Differential revision: https://reviews.freebsd.org/D43928

4 months agonextboot: check unlink, but only warn on !ENOENT
Warner Losh [Thu, 22 Feb 2024 03:10:45 +0000 (20:10 -0700)]
nextboot: check unlink, but only warn on !ENOENT

Emulate rm -f from the nextboot.sh script: Report all errors, except
ENOENT. This problems show through, except the expected one when
nextboot.conf isn't there.

Sponsored by: Netflix
Reviewed by: rew
Differential Revision: https://reviews.freebsd.org/D44013

4 months agolinux_pwd_onexec: do not abort image activation if emul path does not exist
Konstantin Belousov [Sat, 10 Feb 2024 05:02:18 +0000 (07:02 +0200)]
linux_pwd_onexec: do not abort image activation if emul path does not exist

Instead clear the altroot, if any.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D43833

4 months agofdlopen(3): do not create a new object mapping if already loaded
Konstantin Belousov [Thu, 22 Feb 2024 01:18:06 +0000 (03:18 +0200)]
fdlopen(3): do not create a new object mapping if already loaded

This is expected behavior for both dlopen(3) and fdlopen(3).

PR: 277169
Reviewed by: emaste
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D44019

4 months agobcm5974(4): Properly assign MT-slot on Apple Magic Trackpad
Vladimir Kondratyev [Wed, 21 Feb 2024 20:31:39 +0000 (23:31 +0300)]
bcm5974(4): Properly assign MT-slot on Apple Magic Trackpad

Assign multi-touch slot number based on internal evdev MT state and
reported tracking ID of contact rather than on sequentional number of
contact in report.

Sponsored by: Serenity Cyber Security
Fixes: ef8397c28e98 ("add Magic Trackpad 2 (USB only) support")
MFC after: 1 month

4 months agobcm5974(4): Respect HID_DEBUG option and fix debugging printf
Vladimir Kondratyev [Wed, 21 Feb 2024 20:31:39 +0000 (23:31 +0300)]
bcm5974(4): Respect HID_DEBUG option and fix debugging printf

Sponsored by: Serenity Cyber Security
MFC after: 1 month

4 months agobcm5974(4): Report proper width and depth for Apple Magic Trackpads
Vladimir Kondratyev [Wed, 21 Feb 2024 20:31:38 +0000 (23:31 +0300)]
bcm5974(4): Report proper width and depth for Apple Magic Trackpads

The size of modern Apple Magic Trackpad is about 160x110mm

Sponsored by: Serenity Cyber Security
MFC after: 1 month

4 months agoImport the kernel parts of bhyve/arm64
Andrew Turner [Tue, 9 Jan 2024 15:22:27 +0000 (15:22 +0000)]
Import the kernel parts of bhyve/arm64

To support virtual machines on arm64 add the vmm code. This is based on
earlier work by Mihai Carabas and Alexandru Elisei at University
Politehnica of Bucharest, with further work by myself and Mark Johnston.

All AArch64 CPUs should work, however only the GICv3 interrupt
controller is supported. There is initial support to allow the GICv2
to be supported in the future. Only pure Armv8.0 virtualisation is
supported, the Virtualization Host Extensions are not currently used.

With a separate userspace patch and U-Boot port FreeBSD guests are able
to boot to multiuser mode, and the hypervisor can be tested with the
kvm unit tests. Linux partially boots, but hangs before entering
userspace. Other operating systems are untested.

Sponsored by: Arm Ltd
Sponsored by: Innovate UK
Sponsored by: The FreeBSD Foundation
Sponsored by: University Politehnica of Bucharest
Differential Revision: https://reviews.freebsd.org/D37428

4 months agoarm64: Add TF_LR, it will be used by bhyve asm
Andrew Turner [Wed, 21 Feb 2024 18:24:04 +0000 (18:24 +0000)]
arm64: Add TF_LR, it will be used by bhyve asm

4 months agoarm64: Add a macro to find a VM fault address
Andrew Turner [Wed, 21 Feb 2024 18:17:47 +0000 (18:17 +0000)]
arm64: Add a macro to find a VM fault address

Add a macro to find which bits from far_el2 are needed to be copied
to get the full intermediate physical address (IPA).

The hpfar_el2 register only contains a 4k aligned fault address. We
need to include the lower bits from far_el2 if we need the full
faulting IPA.

4 months agoarm64: Add the TCR_EL2.PS mask
Andrew Turner [Wed, 21 Feb 2024 18:16:43 +0000 (18:16 +0000)]
arm64: Add the TCR_EL2.PS mask

4 months agoarm64: Add ISS_MSR_REG for ESR_ELx.ISS values
Andrew Turner [Wed, 21 Feb 2024 18:10:19 +0000 (18:10 +0000)]
arm64: Add ISS_MSR_REG for ESR_ELx.ISS values

Add a macro to get the ESR_ELx ISS value when we trap accessing a
special register.

4 months agoiicbus/mux/pca954x: add support for PCA9546 I2C Switch
Bjoern A. Zeeb [Wed, 21 Feb 2024 09:10:55 +0000 (09:10 +0000)]
iicbus/mux/pca954x: add support for PCA9546 I2C Switch

Add support for the 4 channel I2C switch from NXP by adding a new
description struct and the list entries.  Compared to x=[2345] which
require code to support the INT, for this one no further changes are
needed.

Tested on: WHLE-LS1088A using a SPF+
MFC after: 1 week
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44009

4 months agoarm64: Add more spsr_el1 register values
Andrew Turner [Wed, 21 Feb 2024 15:58:20 +0000 (15:58 +0000)]
arm64: Add more spsr_el1 register values

Sponsored by: Arm Ltd

4 months agoloader/efi: Make gcc friendlier by move md_dev
Warner Losh [Wed, 21 Feb 2024 15:50:31 +0000 (08:50 -0700)]
loader/efi: Make gcc friendlier by move md_dev

Move the extern struct devsw md_dev out of the function. gcc is happier
with this arrangemnt often. However, we really should move it to a
header file, but that requires a bit of a rework of md support and
config.

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

4 months agoloader: Retire CTASSERT
Warner Losh [Wed, 21 Feb 2024 15:48:32 +0000 (08:48 -0700)]
loader: Retire CTASSERT

The project is moving away from CTASSERT in favor of
_Static_assert. Cleanup the few instances in the loader proactively.

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

4 months agolibsys auxv.c: add fences needed to ensure that flag works
Konstantin Belousov [Wed, 21 Feb 2024 14:12:12 +0000 (16:12 +0200)]
libsys auxv.c: add fences needed to ensure that flag works

Noted by: jrtc27
Sponsored by: The FreeBSD Foundation

4 months agoarm64: Fix the has_hyp check
Andrew Turner [Wed, 21 Feb 2024 12:38:49 +0000 (12:38 +0000)]
arm64: Fix the has_hyp check

boot_el is now the CurrentEL.EL field value. Use the new macros to
implement the has_hyp() check.

Sponsored by: Arm Ltd

4 months agoarm64: Add in_vhe() to find if the kernel is in VHE
Andrew Turner [Thu, 11 Jan 2024 17:01:52 +0000 (17:01 +0000)]
arm64: Add in_vhe() to find if the kernel is in VHE

Add a function to support devices that may need to know if the kernel
has enabled the Armv8.1 Virtulization Host Extensions (FEAT_VHE).
Some devices, e.g. the generic timer, will need to know, e.g. use a
different interrupt.

Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D43973

4 months agoarm64: Use the new CurrentEL macros
Andrew Turner [Thu, 15 Feb 2024 16:13:09 +0000 (16:13 +0000)]
arm64: Use the new CurrentEL macros

Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D43972

4 months agoarm64: Add CurrentEL register definitions
Andrew Turner [Mon, 19 Feb 2024 14:57:34 +0000 (14:57 +0000)]
arm64: Add CurrentEL register definitions

Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D43971

4 months agols.1: Mention CLICOLOR environment variable
Gordon Bergling [Wed, 21 Feb 2024 10:54:58 +0000 (11:54 +0100)]
ls.1: Mention CLICOLOR environment variable

Mention CLICOLOR environment variable in the manual page.

PR: 276556
Submitted by: bsdcode at disroot dot org
Reviewed by: imp
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D43970

4 months agoreboot: Emulate nextboot -D better
Warner Losh [Wed, 21 Feb 2024 06:03:15 +0000 (23:03 -0700)]
reboot: Emulate nextboot -D better

It used to produce no output when the file couldn't be removed. Emulate
that better by unlinking and ignoring errors. It's used at the end of
reboot always, even when the file isn't going to be there.

Sponsored by: Netflix
Fixes: 2c479548119a
4 months agoRevert "rc.d/mountlate: discard output from nextboot"
Robert Wing [Wed, 21 Feb 2024 06:04:15 +0000 (21:04 -0900)]
Revert "rc.d/mountlate: discard output from nextboot"

This reverts commit 4cea0cbcc9d3a6583e5325ca081c09c8a9423172.

Requested by:   imp

4 months agorc.d/mountlate: discard output from nextboot
Robert Wing [Wed, 21 Feb 2024 05:50:43 +0000 (20:50 -0900)]
rc.d/mountlate: discard output from nextboot

silent the warning seen at boot:

    Mounting late filesystems:.
    nextboot: unlink /boot/nextboot.conf: No such file or directory

    Sun Feb 18 23:31:52 AKST 2024

    FreeBSD/amd64 (main) (ttyv0)

    login:

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

4 months agoice_ddp: Update package to 1.3.36.0
Eric Joyner [Tue, 13 Feb 2024 06:39:21 +0000 (22:39 -0800)]
ice_ddp: Update package to 1.3.36.0

This is intended to be used with the upcoming ice 1.39.13-k
driver update, but is still backwards compatible with
previous versions of the driver.

Signed-off-by: Eric Joyner <erj@FreeBSD.org>
MFC after: 3 days
Sponsored by: Intel Corporation

4 months agosys/kern: Remove a few sys/cdefs.h around some elf things
Warner Losh [Wed, 21 Feb 2024 03:40:19 +0000 (20:40 -0700)]
sys/kern: Remove a few sys/cdefs.h around some elf things

These sys/cdefs.h are no longer needed. Remove them in advance of
other work in this area.

Sponsored by: Netflix

4 months agokboot: Fix zfs bootonce protocol
Warner Losh [Wed, 21 Feb 2024 03:26:08 +0000 (20:26 -0700)]
kboot: Fix zfs bootonce protocol

This wasn't updated when the other copies were updated. Make it
identical to efi code. We should likely refactor this (with userboot),
but they are all not quite identical.

Sponsored by: Netflix

4 months agoloader: For the mini-stdio we have for lua, #define them to something else
Warner Losh [Wed, 21 Feb 2024 03:31:50 +0000 (20:31 -0700)]
loader: For the mini-stdio we have for lua, #define them to something else

To make it easier to port lua and some of the lua modules, we have a
series of routines to implement the stdio routines, even though we don't
normally implement them in the boot loader. Add a comment to this effect.

Also, some tools, like sanitizers and static analysis tools, make
unwarranted assumptions about these, so #define them to a different name
so they stop.

Sponsored by: Netflix

4 months agobearssl: Make shared library link
Warner Losh [Wed, 21 Feb 2024 03:31:41 +0000 (20:31 -0700)]
bearssl: Make shared library link

Creating a lua shared library module linking against libbearssl.so won't
load w/o these functions.

Sponsored by: Netflix
Reviewed by: sjg
Differential Revision: https://reviews.freebsd.org/D43982

4 months agoloader/libofw: Fix disk size truncation
Justin Hibbits [Tue, 20 Feb 2024 22:08:54 +0000 (17:08 -0500)]
loader/libofw: Fix disk size truncation

At present OF_ioctl first multiplies, then casts to 64-bit, meaning at
the asm level it truncates the result to 32-bit, then zero-extends it to
64-bit to return.  Cast `n` to 64-bit before multiplying, so that the
correct result is returned.

4 months agobhyve: Add support for XML register definitions
Mark Johnston [Wed, 21 Feb 2024 00:21:29 +0000 (19:21 -0500)]
bhyve: Add support for XML register definitions

This is useful for exposing additional registers to debuggers.  For
instance, control registers are now available on amd64 when using gdb to
debug a guest.

The stub indicates support by including the string
"qXfer:features:read+" in its feature list.  The debugger queries for
target descriptions by sending the query "qXfer:features:read:" followed
by a file path.

The XML definitions are copied from QEMU and installed to
/usr/share/bhyve/gdb.

Note that we currently don't handle the SIMD registers at all, since
that's of somewhat limited utility (for me at least) and since that
requires new ioctls to fetch the register values.

Reviewed by: jhb
MFC after: 2 weeks
Sponsored by: Innovate UK
Differential Revision: https://reviews.freebsd.org/D43666

4 months agolibsys: disable ssp
Konstantin Belousov [Tue, 20 Feb 2024 15:13:26 +0000 (17:13 +0200)]
libsys: disable ssp

Reviewed by: brooks, imp
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D43985

4 months agolibsys: move errno to libsys
Konstantin Belousov [Tue, 20 Feb 2024 15:13:09 +0000 (17:13 +0200)]
libsys: move errno to libsys

Before, the 'errno' itself was defined in libc and was referenced by
libsys, causing undesired dependency.

Reviewed by: brooks, imp
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D43985

4 months agolibsys: remove usage of pthread_once and _once_stub
Konstantin Belousov [Tue, 20 Feb 2024 14:45:29 +0000 (16:45 +0200)]
libsys: remove usage of pthread_once and _once_stub

that existed in auxv.c, use simple bool gate instead. This leaves a
small window if two threads try to call _elf_aux_info(3) simultaneously.
The situation is safe because auxv parsing is really idempotent. The
parsed data is the same, and we store atomic types (int/long/ptr) so
double-init does not matter.

Reviewed by: brooks, imp
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D43985

4 months agolibsys: internalize memcpy, memset, and strlcpy
Konstantin Belousov [Tue, 20 Feb 2024 14:28:37 +0000 (16:28 +0200)]
libsys: internalize memcpy, memset, and strlcpy

Reviewed by: brooks, imp
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D43985

4 months agortld: remove pointless "extern"
Konstantin Belousov [Tue, 20 Feb 2024 14:25:48 +0000 (16:25 +0200)]
rtld: remove pointless "extern"

Reviewed by: brooks, imp
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D43985

4 months agotests/sigsys: initialize parameter passed to sysctlbyname()
Gleb Smirnoff [Tue, 20 Feb 2024 22:37:45 +0000 (14:37 -0800)]
tests/sigsys: initialize parameter passed to sysctlbyname()

4 months agotests/fdgrowtable: remove always true check
Gleb Smirnoff [Tue, 20 Feb 2024 22:31:06 +0000 (14:31 -0800)]
tests/fdgrowtable: remove always true check

We are always the parent in this code path.

4 months agotests/fdgrowtable: open more files in the threaded case
Gleb Smirnoff [Tue, 20 Feb 2024 22:31:06 +0000 (14:31 -0800)]
tests/fdgrowtable: open more files in the threaded case

This should fix the test failing on some machines/conditions/runs.  This
won't fix failures in standalone run, but should fix kyua(1) runs.
Currently with standalone run it will usually fail because the 40-sized
allocation is skipped (see details below).

This matches what forking test does: open 128 files in the parent and 128
in the child.  There should actually be no difference where and when the
files are open, but let's mimic the forking test, and open more files in
the spawned thread.  Also opening from two different contexts adds a bit
more entropy to the test.

What the test does it checks that fdgrowtable() has been called at least
three tmes for the test process, and the old tables are still on the free
list as long as other execution contexts exist.  Under kyua(1) control the
first call grows the table from 20 to 40, but the original table of 20 is
an embedded one, thus is not put on the free list.  Passing 40 open files
the table grows to 128 and first old table lands on the free list. Passing
128 open file the table grows to 256 and a second old table lands on the
free list.  After that the test would pass.  The threaded test was one
open file off before this fix sometimes.

4 months agomd5: Untabify declarations.
Dag-Erling Smørgrav [Tue, 20 Feb 2024 22:04:45 +0000 (23:04 +0100)]
md5: Untabify declarations.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: imp, allanjude, markj
Differential Revision: https://reviews.freebsd.org/D43991

4 months agomd5: Fix GNU check mode.
Dag-Erling Smørgrav [Tue, 20 Feb 2024 22:04:40 +0000 (23:04 +0100)]
md5: Fix GNU check mode.

Fixes: 9b20849bc5f1b500f2de7aeca77f0e6556069bbb
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: imp, allanjude, markj
Differential Revision: https://reviews.freebsd.org/D43990

4 months agomd5: Fix Perl mode long options.
Dag-Erling Smørgrav [Tue, 20 Feb 2024 22:04:36 +0000 (23:04 +0100)]
md5: Fix Perl mode long options.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: imp, allanjude, markj
Differential Revision: https://reviews.freebsd.org/D43989

4 months agomd5: Add test case for GNU input modes.
Dag-Erling Smørgrav [Tue, 20 Feb 2024 22:04:32 +0000 (23:04 +0100)]
md5: Add test case for GNU input modes.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: allanjude, markj
Differential Revision: https://reviews.freebsd.org/D43988

4 months agotests/arp: test arp -s/-S work
Gleb Smirnoff [Tue, 20 Feb 2024 18:32:03 +0000 (10:32 -0800)]
tests/arp: test arp -s/-S work

Install permanent entry, try to modify it, check that
net.link.ether.inet.log_arp_permanent_modify works.

4 months agotests/arp: when checking 'arp -d' check that entry is removed
Gleb Smirnoff [Tue, 20 Feb 2024 18:32:03 +0000 (10:32 -0800)]
tests/arp: when checking 'arp -d' check that entry is removed

Previous check trusted the "entry was deleted" output of the command.
Improved check does additional request to make sure that entry is not
returned.

4 months agoarp: fix arp -s/-S
Gleb Smirnoff [Tue, 20 Feb 2024 18:31:05 +0000 (10:31 -0800)]
arp: fix arp -s/-S

When setting a permanent ARP entry, the route(4) would use
rtm->rtm_rmx.rmx_expire == 0 as a flag for installing a static entry, but
netlink(4) is looking for explicit NTF_STICKY flag in the request.  The
arp(8) utility was adopted to use netlink(4) by default, but it has lots
of route-era guts internally. Specifically there is global variable 'opts'
that shares configuration for both protocols, and it is still initialized
with route(4) specific RTF_xxx flags.  In set_nl() these flags are
translated to netlink(4) parameters. However, RTF_STATIC is a flag that is
never set by default, so attempt to use it as a proxy flag manifesting
-s/-S results in losing it.  Use zero opts.expire_time as a manifest of
-s/-S operation.  This is a minimal fix.  A better one would be to fully
get rid of route(4) legacy.

The change also corrects the logic to set NUD_PERMANENT flag for
consistency.  This flag is ignored by our kernel (now).

Reviewed by: melifaro, tuexen, emaste
PR: 277063
Fixes: 6ad73dbf65048b0950a1ba6ff25607f6708c8954
Differential Revision: https://reviews.freebsd.org/D43983

4 months agoiwm.4: add iwlwifi cross-reference
Ed Maste [Tue, 20 Feb 2024 16:43:00 +0000 (11:43 -0500)]
iwm.4: add iwlwifi cross-reference

iwlwifi(4) supports a superset of the devices supported by iwm(4).  The
latter may be retired in the future (if there is no reason to prefer it
for the set of devices supported by both).

Sponsored by: The FreeBSD Foundation

4 months agomsdosfs: fix potential inode collision on FAT12 and FAT16
Stefan Eßer [Tue, 20 Feb 2024 12:02:24 +0000 (13:02 +0100)]
msdosfs: fix potential inode collision on FAT12 and FAT16

FAT file systems do not use inodes, instead all file meta-information
is stored in directory entries.

FAT12 and FAT16 use a fixed size area for root directories, with
typically 512 entries of 32 bytes each (for a total of 16 KB) on hard
disk formats. The file system data is stored in clusters of typically
512 to 4096 bytes, depending on the size of the file system.

The current code uses the offset of a DOS 8.3 style directory entry as
a pseudo-inode, which leads to inode values of 0 to 16368 for typical
root directories with 512 entries.

Sub-directories use 2 cluster length plus the byte offset of the
directory entry in the data area for the pseudo-inode, which may be
as low as 1024 in case of 512 byte clusters. A sub-directory in
cluster 2 and with 512 byte clusters will therefore lead to a
re-use of inode 1024 when there are at least 32 DOS 8.3 style
filenames in the root directory (or 11 14-character Windows
long file names, each of which takes up 3 directory entries).

FAT32 file systems are not affected by this issue and FAT12/FAT16
file systems with larger cluster sizes are unlikely to have as
many directory entries in the root directory as are required to
cause the collision.

This commit leads to inode numbers that are guaranteed to not collide
for all valid FAT12 and FAT16 file system parameters. It does also
provide a small speed-up due to more efficient use of the vnode cache.

Approved by: mckusick
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D43978

4 months agotools/net80211/wlanwatch: Remove obsolete code.
Joseph Koshy [Mon, 19 Feb 2024 16:46:45 +0000 (16:46 +0000)]
tools/net80211/wlanwatch: Remove obsolete code.

The symbol NI_WITHSCOPEID has not been defined by <netdb.h> since
May 2005 (since SVN r146690).

4 months agonextboot: fix nextboot -k on ZFS
Gleb Smirnoff [Tue, 20 Feb 2024 03:51:22 +0000 (19:51 -0800)]
nextboot: fix nextboot -k on ZFS

zfsbootcfg(1) expects pool name to operate on, not currently mounted
filesystem name.

Fixes: fd6d47375a78fbf0737012b7cc11180291781e8b

4 months agonextboot: fix typo that merged two args into one
Gleb Smirnoff [Tue, 20 Feb 2024 03:51:22 +0000 (19:51 -0800)]
nextboot: fix typo that merged two args into one

Fixes: fd6d47375a78fbf0737012b7cc11180291781e8b

4 months agoEliminate unnecessary UFS1 integrity checks.
Kirk McKusick [Tue, 20 Feb 2024 00:16:07 +0000 (16:16 -0800)]
Eliminate unnecessary UFS1 integrity checks.

The UFS1 integrity checks added in FreeBSD 14 were too aggressive
for UFS1 filesystems created in FreeBSD 4 and 9 systems. This patch
removes those tests which can be done safely since they are not
relevant to the current implementation of UFS1.

This is a follow-on report to bug report 264450 (comments 21-28).

Reported by: slb@sonnet.com
Tested by:   slb@sonnet.com
PR:          264450
MFC after:   1 week

4 months agozlib: use more memory for a small deflate speedup.
Xin LI [Mon, 19 Feb 2024 23:01:04 +0000 (15:01 -0800)]
zlib: use more memory for a small deflate speedup.

The LIT_MEM option uses slightly more memory (for base gzip(1),
about 16kiB; according to the author, about 6% for default deflate
settings) for a small speedup.

The performance gain is more noticeable for input data with higher
entropy and less significant for data that is highly compressible,
such as source code and logs.

MFC after: 1 month

4 months agolib{c,thr}: add DT_RUNPATH for gcc -m32
Brooks Davis [Mon, 19 Feb 2024 22:44:08 +0000 (22:44 +0000)]
lib{c,thr}: add DT_RUNPATH for gcc -m32

To allow gcc -m32 to work, link libc and libthr with --rpath-/usr/lib32.
When called with -m32, gcc is currently unable to communicate to
the bfd linker that it should look in /usr/lib32 to resolve needed (as
opposed to explicitly linked) libraries so we need to provide a hint.

See also: https://sourceware.org/bugzilla/show_bug.cgi?id=31395

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D43910

4 months agolib{c,sys}: move auxargs more firmly into libsys
Brooks Davis [Mon, 19 Feb 2024 22:44:08 +0000 (22:44 +0000)]
lib{c,sys}: move auxargs more firmly into libsys

Continue to filter the public interface (elf_aux_info()), but entierly
relocate the private interfaces (_elf_aux_info(),
__init_elf_aux_vector(), and __elf_aux_vector) to libsys.

This ensures that rtld updates the correct (only) copy of
__elf_aux_vector.  After 968a18975adc9c2a619bb52aa2f009de99fc9e24
updates were confused and __getosreldate was failing, causing
the system to fall back to compat compat12 syscalls in some cases.

Return to explicitly linking libc to libsys and link libthr with libc
and libsys (in that order).

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D43910

4 months agols: Fix -v and associated test
Warner Losh [Mon, 19 Feb 2024 16:48:05 +0000 (09:48 -0700)]
ls: Fix -v and associated test

The cleanup of d854370fa86b7 had a cut and paste error (so f_verssort
was set to 1 and then to 0 rather thame f_timesort being set to 0).

Fixes: d854370fa86b7
Sponsored by: Netflix

4 months agoumtxvar.h: Add missing include
Olivier Certner [Thu, 8 Feb 2024 20:11:17 +0000 (21:11 +0100)]
umtxvar.h: Add missing include

Necessary to have the definition of 'struct timespec'.

No functional change.

Approved by:        markj (mentor)
MFC after:          3 days
Sponsored by:       The FreeBSD Foundation

4 months agosched: sched_switch(): Factorize sleepqueue flags
Olivier Certner [Tue, 16 Jan 2024 09:42:11 +0000 (10:42 +0100)]
sched: sched_switch(): Factorize sleepqueue flags

Avoid duplicating common flags for the preempted and non-preempted
cases, making it clear that they are the same without resorting to
formatting.

No functional change.

Approved by:        markj (mentor)
MFC after:          3 days
Sponsored by:       The FreeBSD Foundation

4 months agocommitters-src: Add bnovkov@ with markj@ and jhb@ as mentors
Bojan Novković [Mon, 19 Feb 2024 15:55:31 +0000 (16:55 +0100)]
committers-src: Add bnovkov@ with markj@ and jhb@ as mentors

Add mentorship information for bnovkov@.

Approved by:  markj (mentor)
Differential Revision: https://reviews.freebsd.org/D43963

4 months agonet80211: Fix two typos in kernel messages
Gordon Bergling [Mon, 19 Feb 2024 11:08:07 +0000 (12:08 +0100)]
net80211: Fix two typos in kernel messages

- s/defered/deferred/

MFC after: 5 days

4 months agoiov.h: Fix a typo in a source code comment
Gordon Bergling [Mon, 19 Feb 2024 11:02:57 +0000 (12:02 +0100)]
iov.h: Fix a typo in a source code comment

- s/subystem/subsystem/

MFC after: 3 days

4 months agougen: fix USB_IFACE_DRIVER_ACTIVE after detaching a driver
Andriy Gapon [Mon, 19 Feb 2024 10:44:00 +0000 (12:44 +0200)]
ugen: fix USB_IFACE_DRIVER_ACTIVE after detaching a driver

Previosuly, USB_IFACE_DRIVER_ACTIVE would report that the driver is
active even after it detached.  That's because a device(9) still
remains.

So, add device_is_alive(9) check for more accurate reporting.

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

4 months agoscsi_da: add 4K quirks for Samsung SSD 860 and 870
Andriy Gapon [Mon, 19 Feb 2024 10:16:47 +0000 (12:16 +0200)]
scsi_da: add 4K quirks for Samsung SSD 860 and 870

Although the actual flash page size is either 8K or 16K for those
devices (according to different sources of various reliability), they
seem to be optimized for the "industry-standard" emulated 4K block size.

To do: consolidate very similar Samsung SSD entries for 830 - 870
models.

MFC after: 2 weeks

4 months agoata_da: add quirk to disable NCQ TRIM for Samsung 860/870 SSDs
Andriy Gapon [Mon, 19 Feb 2024 10:08:12 +0000 (12:08 +0200)]
ata_da: add quirk to disable NCQ TRIM for Samsung 860/870 SSDs

NCQ TRIM for Samsung 860/870 SSDs results in data corruption on systems
with some SATA controllers.

This can be easily reproduced using ZFS which uses TRIM and is able to
detect block content changes.

Linux bug report for this issue:
 https://bugzilla.kernel.org/show_bug.cgi?id=201693

Since at present we can not limit a quirk based on the contorller / SIM,
apply the quirk in all cases.

Reviewed by: imp
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D43961

4 months agondp(8): increase buffer size in rtsock mode
Boris Lytochkin [Mon, 19 Feb 2024 07:44:52 +0000 (10:44 +0300)]
ndp(8): increase buffer size in rtsock mode

On a router with many connected devices (~10k+) `ndp -an` can fail
with ENOMEM because of some additional NDP records were added
between sysctl() buffer size estimate and data fetch calls.

Allocate more space based on size estimate: 1/64 (~2%) of additional
space, but not less that 4 m_rtmsg structures.

Obtained from: Yandex LLC
MFC after: 2 weeks
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D43956

4 months agoada: Another NCQ Trim instability drive
Warner Losh [Mon, 19 Feb 2024 05:10:55 +0000 (22:10 -0700)]
ada: Another NCQ Trim instability drive

The Seagate IronWolf 110 SATA SSD drive has been reported to be unstable
with NCQ trim enabled.

PR: 264139
Sponsored by: Netflix

4 months agocrontab/crontab.1: Fix crontab path in man
Muhammad Moinur Rahman [Sun, 18 Feb 2024 23:56:16 +0000 (00:56 +0100)]
crontab/crontab.1: Fix crontab path in man

In FreeBSD the crontabs are stored in /var/cron/tabs directory and not
in /var directory.

Approved by: kevans
Differential Revision: https://reviews.freebsd.org/D43181

4 months agorelease/tools: Add support for building armv7 vm
Muhammad Moinur Rahman [Sun, 18 Feb 2024 23:49:52 +0000 (00:49 +0100)]
release/tools: Add support for building armv7 vm

Currently there is no support for generating armv7 vm images in the
release artifacts. In fact in terms of release artifacts and
architecture there is no good reason to have a vm release artifact for
armv7 as those are mostly used in SOCs or embedded boards. However
considering that developers actually do need an easy way to test armv7
with a vm running this is really important. As part of pre-commit ci for
developers this can be really helpful for the end developers.

Approved by: cperciva, imp, re
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43952

4 months agowc: Fix SIGINFO race with casper init.
Bryan Drewery [Sun, 18 Feb 2024 18:55:11 +0000 (10:55 -0800)]
wc: Fix SIGINFO race with casper init.

If a file is specified then fileargs_init(3) may return [EINTR]. With
the SIGINFO handler not being SA_RESTART this causes an early exit
if a SIGINFO comes in. Rather than checking for [EINTR] or changing the
handler just move it later which resolves the problem.

4 months agonet80211: increase number of spares in struct ieee80211_vap
Bjoern A. Zeeb [Sun, 18 Feb 2024 17:47:22 +0000 (17:47 +0000)]
net80211: increase number of spares in struct ieee80211_vap

Turns out MFCing 713db49d06deee90dd358b2e4b9ca05368a5eaf6 does not
leave us with enough spares.  Given wireless will likely see more
changes in the near future add more spares.
This is especially necessary given 'struct ieee80211_vap' gets
allocated by drivers.
Bumps size of struct ieee80211_vap to (7 * 512) on 64bit.

4 months agosdiff: Fix binary case.
Dag-Erling Smørgrav [Sun, 18 Feb 2024 17:39:31 +0000 (18:39 +0100)]
sdiff: Fix binary case.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D43942

4 months agosdiff: Fix --expand-tabs and --tabsize.
Dag-Erling Smørgrav [Sun, 18 Feb 2024 17:39:28 +0000 (18:39 +0100)]
sdiff: Fix --expand-tabs and --tabsize.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D43941

4 months agosdiff: Misc cleanup.
Dag-Erling Smørgrav [Sun, 18 Feb 2024 17:39:23 +0000 (18:39 +0100)]
sdiff: Misc cleanup.

MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D43943

4 months agosnd_hda: Add patches for the Lenovo Ideapad 330-15 and ThinkPad X230
Dmitry Lukhtionov [Sun, 18 Feb 2024 17:07:39 +0000 (19:07 +0200)]
snd_hda: Add patches for the Lenovo Ideapad 330-15 and ThinkPad X230

PR: 259640
MFC after: 2 weeks
Reviewed by: delphij, markj
Differential Revision: https://reviews.freebsd.org/D43804

4 months agork8xx_poweroff: add parentheses missed in 8b408fc6f2
Andriy Gapon [Sun, 18 Feb 2024 16:26:20 +0000 (18:26 +0200)]
rk8xx_poweroff: add parentheses missed in 8b408fc6f2

Fixes: 8b408fc6f2
MFC after: 2 weeks

4 months agounionfs: work around underlying FS failing to respect cn_namelen
Jason A. Harmening [Sun, 24 Dec 2023 04:48:19 +0000 (22:48 -0600)]
unionfs: work around underlying FS failing to respect cn_namelen

unionfs_mkshadowdir() may be invoked on a non-leaf pathname component
during lookup, in which case the NUL terminator of the pathname buffer
will be well beyond the end of the current component.  cn_namelen in
this case will still (correctly) indicate the length of only the
current component, but ZFS in particular does not currently respect
cn_namelen, leading to the creation on inacessible files with slashes
in their names.  Work around this behavior by temporarily NUL-
terminating the current pathname component for the call to VOP_MKDIR().

https://github.com/openzfs/zfs/issues/15705 has been filed to track
a proper upstream fix for the issue at hand.

PR: 275871
Reported by: Karlo Miličević <karlo98.m@gmail.com>
Tested by: Karlo Miličević <karlo98.m@gmail.com>
Reviewed by: kib, olce
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D43818

4 months agounionfs: upgrade the vnode lock during fsync() if necessary
Jason A. Harmening [Sun, 24 Dec 2023 04:42:28 +0000 (22:42 -0600)]
unionfs: upgrade the vnode lock during fsync() if necessary

If the underlying upper FS supports shared locking for write ops,
as is the case with ZFS, VOP_FSYNC() may only be called with the vnode
lock held shared.  In this case, temporarily upgrade the lock for
those unionfs maintenance operations which require exclusive locking.

While here, make unionfs inherit the upper FS' support for shared
write locking.  Since the upper FS is the target of VOP_GETWRITEMOUNT()
this is what will dictate the locking behavior of any unionfs caller
that uses vn_start_write() + vn_lktype_write(), so unionfs must be
prepared for the caller to only hold a shared vnode lock in these
cases.

Found in local testing of unionfs atop ZFS with DEBUG_VFS_LOCKS.

MFC after: 2 weeks
Reviewed by: kib, olce
Differential Revision: https://reviews.freebsd.org/D43817

4 months agoVFS: update VOP_FSYNC() debug check to reflect actual locking policy
Jason A. Harmening [Tue, 26 Dec 2023 02:02:25 +0000 (20:02 -0600)]
VFS: update VOP_FSYNC() debug check to reflect actual locking policy

Shared vs. exclusive locking is determined not by MNT_EXTENDED_SHARED
but by MNT_SHARED_WRITES (although there are several places that
ignore this and simply always use an exclusive lock).  Also add a
comment on the possible difference between VOP_GETWRITEMOUNT(vp)
and vp->v_mount on this path.

Found by local testing of unionfs atop ZFS with DEBUG_VFS_LOCKS.

MFC after: 2 weeks
Reviewed by: kib, olce
Differential Revision: https://reviews.freebsd.org/D43816

4 months agounionfs: cache upper/lower mount objects
Jason A. Harmening [Fri, 22 Dec 2023 20:13:35 +0000 (14:13 -0600)]
unionfs: cache upper/lower mount objects

Store the upper/lower FS mount objects in unionfs per-mount data and
use these instead of the v_mount field of the upper/lower root
vnodes.  As described in the referenced PR, it is unsafe to access this
field on the unionfs unmount path as ZFS rollback may have obliterated
the v_mount field of the upper or lower root vnode.  Use these stored
objects to slightly simplify other code that needs access to the
upper/lower mount objects as well.

PR: 275870
Reported by: Karlo Miličević <karlo98.m@gmail.com>
Tested by: Karlo Miličević <karlo98.m@gmail.com>
Reviewed by: kib (prior version), olce
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D43815

4 months agosyscon_power: do reboot after shutdown_panic is executed
Andriy Gapon [Fri, 9 Jul 2021 15:00:21 +0000 (18:00 +0300)]
syscon_power: do reboot after shutdown_panic is executed

A syscon_power instance can handle either poweroff or reboot, but not
both.  If the instance handles reboot then set its priority to be after
shutdown_panic.

This is to provide uniform experience with other platforms.

MFC after: 3 weeks

4 months agopsci: split off psci_reboot from psci_shutdown
Andriy Gapon [Fri, 9 Jul 2021 15:01:57 +0000 (18:01 +0300)]
psci: split off psci_reboot from psci_shutdown

Priority of psci_reboot set so that it is run after shutdown_panic is
executed.  This is to provide uniform experience with other platforms.

MFC after: 3 weeks

4 months agork8xx_poweroff: enable power-cycling on support hardware
Andriy Gapon [Sun, 18 Feb 2024 13:57:34 +0000 (15:57 +0200)]
rk8xx_poweroff: enable power-cycling on support hardware

Previously, the function would return early if RB_POWERCYCLE was
specified without RB_POWEROFF.  Those flags are exclusive at the moment,
that is, they are never set together.

Søren Schmidt (sos) uses a similar but extended patch locally.

MFC after: 2 weeks

4 months agoaw_gpio: temporarily switch to input function if read in eint mode
Andriy Gapon [Sun, 18 Feb 2024 13:55:20 +0000 (15:55 +0200)]
aw_gpio: temporarily switch to input function if read in eint mode

This is needed for gpiokeys driver that needs to read input state after
receiving an interrupt for either edge.

PR: 248138
MFC after: 1 month

4 months agosctp(4): Fix a typo in a source code comment
Gordon Bergling [Sun, 18 Feb 2024 12:01:04 +0000 (13:01 +0100)]
sctp(4): Fix a typo in a source code comment

- s/anthing/anything/

MFC after: 3 days

4 months agotzcode: Fix overflow handling in TZ parser.
Dag-Erling Smørgrav [Sun, 18 Feb 2024 09:48:08 +0000 (10:48 +0100)]
tzcode: Fix overflow handling in TZ parser.

Obtained from: upstream 9fc11a27
MFC after: 1 week
PR: 276281

4 months agoboot/universe.sh: Add tests to keep MK_LOADER_BIOS_TEXTONLY working
Warner Losh [Sun, 18 Feb 2024 06:28:33 +0000 (23:28 -0700)]
boot/universe.sh: Add tests to keep MK_LOADER_BIOS_TEXTONLY working

Sponsored by: Netflix

4 months agoloader: Make MK_LOADER_BIOS_TEXTONLY work
Warner Losh [Sun, 18 Feb 2024 06:15:01 +0000 (23:15 -0700)]
loader: Make MK_LOADER_BIOS_TEXTONLY work

Select between text-only and graphical frame buffer consoles for the
BIOS boot loader. Pull one or the other in with #ifdef in conf.c. Add
gfx_bios.c for the few routines that are needed for the BIOS support of
gfx. These are stubbed out for text-only mode. Move bi_load_vbe_data
here since it's only used for the graphical frame buffer.

Note: This setup also allows us to build multiple BIOS loaders if we
have to, some with text-only and some graphical. We don't do this today.
We may be forced to turn this on in the future if ZFS keeps growing.

The size savings is 41k, which helps a lot with some of our users that
want to enable more options in the BIOS boot loader than are normally
safe to do, and they don't need graphics.

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

4 months agoloader: Add textvidc to build
Warner Losh [Sun, 18 Feb 2024 06:14:56 +0000 (23:14 -0700)]
loader: Add textvidc to build

Add textvidc to the build. And use -DTERM_EMU to build it.

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

4 months agoloader: Add new option WITH_LOADER_BIOS_TEXTONLY
Warner Losh [Sun, 18 Feb 2024 06:14:50 +0000 (23:14 -0700)]
loader: Add new option WITH_LOADER_BIOS_TEXTONLY

This option will omit all the graphics support, the teken terminal
library, video mode support, etc and support a simple, basic, text-only
video console for the x86 BIOS boot loader. It uses the FreeBSD 12
version of vidconsole.c. It defaults to NO.

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

4 months agoloader: bring back old text-only video console
Warner Losh [Sun, 18 Feb 2024 06:14:44 +0000 (23:14 -0700)]
loader: bring back old text-only video console

Bring back vidconsole.c as textvidc.c from 2a0e2c88db20. This console
does no graphics stuff at all, supports no fancy logos, has known bugs
in the terminal emulation, etc. However, it is small. It will be a
build-time option to select between the two. The BIOS loader is running
out of space when too many options are selected, so this allows people
to select the smaller one to spend the space elsewhere. This is only the
verbatim copy of the old vidconsole.c. It's not yet connected to the
build.

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

4 months agoMFV: zlib 1.3.1.
Xin LI [Sun, 18 Feb 2024 06:12:51 +0000 (22:12 -0800)]
MFV: zlib 1.3.1.

MFC after: 1 week

4 months agoreboot: Move extern for environ
Warner Losh [Sun, 18 Feb 2024 04:30:48 +0000 (21:30 -0700)]
reboot: Move extern for environ

envorin isn't defined in any header, and gcc is cranky with this inside
a function, so move it to global scope. Both clang and gcc are now happy
with this.

Sponsored by: Netflix