Commit graph

2086 commits

Author SHA1 Message Date
Toomas Soome
21b5b8b38b loader.efi: add "gop blt <on|off>" command
Some systems have very slow console output and it may be about either
wrong memory attributes are set or gop->Blt() implementation is bad.

We do not have good way to set memory attributes, but we can
choose which Blt() to use (or we can set "gop off" to fall back on
use of SimpleTextOutput protocol).

This update adds argument for "gop" command to switch gop->Blt() use.
Note, this update does not fix the problem, but allows us to try to
understand the possible cause.

PR:		254381
Reported by:	Michael Galassi

Reviewed by:	manu, imp
Differential Revision:	https://reviews.freebsd.org/D49073
2025-02-20 21:50:20 +02:00
Warner Losh
36f1db7a37 loader.conf: Document boot_verbose
And for the moment, point people to loader.efi(8) for all boot_*
variables.

Sponsored by: Netflix
MFC After: 1 week
2025-02-09 11:24:22 -07:00
Colin Percival
44a768e1a8 stand: Use SOURCE_DATE_EPOCH in newvers.sh
The newvers.sh script is used to generate vers.c for 10 programs (at
latest count on amd64): 4 EFI loaders, 3 x86 loaders, two userboots,
and one kboot.  When building without MK_REPRODUCIBLE_BUILD this
resulted in 10 different timestamps being compiled into various files.

If SOURCE_DATE_EPOCH is set, use that value rather than the current
date and time.

Reviewed by:	emaste, imp
Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D48803
2025-02-03 15:58:32 -08:00
Kirk McKusick
aa90fbed15 Standardize the definition of a UFS dinode.
Each program that operates on UFS on-disk inodes defines its own
version of a dinode. They all (of necessity) define the same
layout but use different names. This change adds a definition of
a dinode (a union of a UFS1 on-disk inode and a UFS2 on-disk inode)
as well as a dinodep (a union of a pointer to a UFS1 on-disk inode
and a pointer to a UFS2 on-disk inode) in sys/ufs/ufs/dinode.h.
It then deletes the definitions of dinode and dinodep in all the
programs that operate on them and instead uses these standard
definitions.

No functional change intended.

MFC-after: 1 week
2025-01-27 17:39:45 -08:00
Alexander Ziaee
066ef2aec1
ports/filesystems: Fix fallout
A new filesystems category was created in the ports tree, with 142
filesystem related ports moved to there, some of them renamed.
Update all references in the src tree to the new locations.

PR:		283881
Fixes:		ports:6e2da9672f79f44 (filesystems: add new category)
MFC after:	1 month
Reviewed by:	fuz, mhorne, bapt
Accepted by:	mhorne (mentor)
Differential Revision:	https://reviews.freebsd.org/D48406
2025-01-27 15:03:10 -05:00
Ahmad Khalifa
86077f4fd1 stand: use globals for the kernel and module types
Reviewed by: imp, kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/1394
2025-01-24 14:29:39 -07:00
Ahmad Khalifa
c75ba31904 stand: file_loadraw: make 'type' a const char *
Reviewed by: imp, kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/1394
2025-01-24 14:29:39 -07:00
Ahmad Khalifa
707136024f stand: remove unnecessary checks for "elfN kernel"
We never set the kernel type to either "elf64 kernel" nor "elf32
kernel".

Reviewed by: imp, kib
Pull Request: https://github.com/freebsd/freebsd-src/pull/1394
2025-01-24 14:25:52 -07:00
Andrew Turner
d249bcb712 stand/efi: Limit where we load the arm64 kernel
When FEAT_LPA2 is implemented the hardware supports increasing the
physical address space from 48-bit to 52-bit.

As older kernels only support a 48-bit physical address space limit
where the kernel is loaded to this.

Reviewed by:	kib, markj
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D46625
2025-01-24 12:09:28 +00:00
Andrew Turner
038457dde9 stand/efi: Add more pl011-like uarts
The Arm SBSA uarts are handled by the pl011 driver. Add them to the
list of pl011 uarts.

Reviewed by:	manu, imp
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D48526
2025-01-23 17:26:25 +00:00
Andrew Turner
7eb3273a7b stand/efi: Use hex values to get the uart type
To keep the SPCR uart type to name map aligned always use the hex value
as an index in the types array.

Reviewed by:	manu, imp
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D48525
2025-01-23 17:26:25 +00:00
Alexander Leidinger
2a44cccd40 Add option to clear caller-used registers on function return.
The WITH_ZEROREGS option for src.conf will zero caller-used register
contents just before returning from a function, ensuring that
temporary values are not leaked beyond the function boundary. This
means that register contents are less likely to be available for side
channel attacks and information exposures.

It reduces all except 1 of the simple "write-what-where" ROP gadgets in
/lib:
    grep "Gadget found" /tmp/before_lib* | wc -l
     197
    grep "Gadget found" /tmp/after_lib* | wc -l
       1
    grep "Gadget found" /tmp/after_lib*
    /tmp/after_libbsdxml.so.4.txt:  [+] Gadget found: 0x1b3f1 mov qword ptr [rdi], rcx ; pop rbp ; ret

To reproduce:
    for lib in *.so.*; do
        echo $lib:
        ROPgadget --ropchain --binary /tmp/be_mount.Sx87/lib/$lib | sed -n '/Step 1/,/Step 2/p' >! /tmp/before_$lib.txt
        ROPgadget --ropchain --binary $lib | sed -n '/Step 1/,/Step 2/p' >!  /tmp/after_$lib.txt
    done

Additionally, in some cases this reduces the number of all ROP gadgets
(quick check with /libs only):
libalias.so.7: reduction 10.000%
libavl.so.2: reduction 13.900%
libbsdxml.so.4: reduction 37.500%
libc.so.7: reduction 10.000%
libc++.so.1: reduction 14.800%
libcam.so.7: reduction 50.700%
libcap_netdb.so.1: reduction 5.800%
libcasper.so.1: reduction 14.600%
libcrypto.so.30: reduction 7.500%
libdtrace.so.2: reduction 3.900%
libelf.so.2: reduction 15.800%
libgcc_s.so.1: reduction 32.700%
libibverbs.so.1: reduction 5.300%
libicp.so.3: reduction 2.100%
libipt.so.0: reduction 28.200%
libirdma.so.1: reduction 1.600%
libkiconv.so.4: reduction 0%
libm.so.5: reduction 21.900%
libmd.so.6: reduction 0%
libmd.so.7: reduction 3.100%
libncursesw.so.9: reduction 11.200%
libnvpair.so.2: reduction 40.200%
libpcap.so.8: reduction 11.400%
libpjdlog.so.0: reduction 27.400%
libsbuf.so.6: reduction 2.900%
libspl.so.2: reduction 42.300%
libsys.so.7: reduction 2.700%
libthr.so.3: reduction 21.000%
libuutil.so.2: reduction 13.100%
libz.so.6: reduction 5.600%
libzpool.so.2: reduction 15.100%

In some cases it adds some ROP gadgets despite removing the simple ROP
gadgets:
lib80211.so.1: reduction -32.700%
libbe.so.1: reduction -22.300%
libbegemot.so.4: reduction -20.500%
libcap_dns.so.2: reduction -58.000%
libcap_fileargs.so.1: reduction -28.200%
libcap_grp.so.1: reduction -54.000%
libcap_net.so.1: reduction -28.800%
libcap_pwd.so.1: reduction -38.800%
libcap_sysctl.so.2: reduction -71.100%
libcap_syslog.so.1: reduction -15.000%
libcrypt.so.5: reduction -14.600%
libctf.so.2: reduction -.300%
libcxxrt.so.1: reduction -14.000%
libdevstat.so.7: reduction -1.600%
libedit.so.8: reduction -4.200%
libgeom.so.5: reduction -16.500%
libicp_rescue.so.3: reduction -2.300%
libipsec.so.4: reduction -31.800%
libjail.so.1: reduction -21.700%
libkvm.so.7: reduction -5.300%
libmlx5.so.1: reduction -6.300%
libmt.so.5: reduction -23.000%
libnv.so.1: reduction -.400%
librss.so.1: reduction -3.800%
librt.so.1: reduction -24.000%
libssp.so.0: reduction -21.100%
libstats.so.0: reduction -9.000%
libtinfow.so.9: reduction -3.500%
libtpool.so.2: reduction -36.500%
libufs.so.8: reduction -11.900%
libulog.so.0: reduction -67.400%
libumem.so.2: reduction -2.000%
libutil.so.9: reduction -7.200%
libxo.so.0: reduction -9.000%
libzdb.so.2: reduction -11.700%
libzfs_core.so.2: reduction -17.700%
libzfs.so.4: reduction -.300%
libzfsbootenv.so.1: reduction -26.900%
libzutil.so.2: reduction -5.600%

To reproduce:
    for lib in *.so.*; do
        echo -n $lib:
        before="$(ROPgadget --nosys --nojop --binary /tmp/be_mount.Sx87/lib/$lib | tail -n1 | cut -d : -f 2)"
        after="$(ROPgadget --nosys --nojop --binary $lib | tail -n1 | cut -d : -f 2)"
        echo " reduction" $(bc -S 3 -e "(1-${after}/${before})*100")%
    done >/tmp/reduction.txt

Most of the time the size difference is very small (<1% for >50% of the
files and >10% for only 2 files):
lib80211.so.1: size change .100%
libalias.so.7: size change 0%
libavl.so.2: size change 0%
libbe.so.1: size change .100%
libbegemot.so.4: size change .100%
libbsdxml.so.4: size change 0%
libc.so.7: size change 1.200%
libc++.so.1: size change 1.600%
libcam.so.7: size change 1.900%
libcap_dns.so.2: size change .100%
libcap_fileargs.so.1: size change .100%
libcap_grp.so.1: size change .100%
libcap_net.so.1: size change .100%
libcap_netdb.so.1: size change .100%
libcap_pwd.so.1: size change .100%
libcap_sysctl.so.2: size change .100%
libcap_syslog.so.1: size change .100%
libcasper.so.1: size change 0%
libcrypt.so.5: size change 3.900%
libcrypto.so.30: size change 1.400%
libctf.so.2: size change .100%
libcxxrt.so.1: size change .100%
libdevstat.so.7: size change 15.400%		exceptional
libdtrace.so.2: size change .600%
libedit.so.8: size change 1.800%
libelf.so.2: size change .100%
libgcc_s.so.1: size change 3.000%
libgeom.so.5: size change 0%
libibverbs.so.1: size change .100%
libicp_rescue.so.3: size change .100%
libicp.so.3: size change 1.500%
libipsec.so.4: size change .100%
libipt.so.0: size change 3.100%
libirdma.so.1: size change .100%
libjail.so.1: size change .100%
libkiconv.so.4: size change .100%
libkvm.so.7: size change .100%
libm.so.5: size change 1.700%
libmd.so.6: size change 0%
libmd.so.7: size change .100%
libmlx5.so.1: size change 0%
libmt.so.5: size change .100%
libncursesw.so.9: size change 1.900%
libnv.so.1: size change 4.300%
libnvpair.so.2: size change 4.300%
libpcap.so.8: size change 1.200%
libpjdlog.so.0: size change .100%
librss.so.1: size change .200%
librt.so.1: size change .100%
libsbuf.so.6: size change .100%
libspl.so.2: size change 0%
libssp.so.0: size change .100%
libstats.so.0: size change .100%
libsys.so.7: size change .100%
libthr.so.3: size change 2.400%
libtinfow.so.9: size change 1.600%
libtpool.so.2: size change .100%
libufs.so.8: size change .100%
libulog.so.0: size change .100%
libumem.so.2: size change 54.300%		exceptional
libutil.so.9: size change .100%
libuutil.so.2: size change .100%
libxo.so.0: size change .100%
libz.so.6: size change .100%
libzdb.so.2: size change .300%
libzfs_core.so.2: size change .100%
libzfs.so.4: size change 2.000%
libzfsbootenv.so.1: size change .100%
libzpool.so.2: size change 1.200%
libzutil.so.2: size change 0%
2025-01-22 19:33:23 +01:00
Yongbo Yao
2f35419fb2 stand/efihttp: Add device type check to efihttp_fs_open()
Ensure the open operation targets an HTTP device. Return EINVAL if
not, to prevent potential system crashes when used on other devices.

Differential Revision: https://reviews.freebsd.org/D48439
Reviewed by: dab, imp, vangyzen
Sponsored by: Dell Technologies
2025-01-19 11:00:26 -06:00
John Baldwin
40d7ba0877 stand/kshim: Replace devclass_equal with calls to strcmp
Reviewed by:	imp, markj, emaste
Differential Revision:	https://reviews.freebsd.org/D48412
2025-01-10 23:03:32 -05:00
John Baldwin
f6f5aa8a2d stand/usb: Quiet warnings so this builds again
Reviewed by:	markj, emaste
Differential Revision:	https://reviews.freebsd.org/D48411
2025-01-10 23:03:32 -05:00
John Baldwin
8e4535ee58 stand/kshim: Implement bus_detach_children
While here, update bus_generic_detach to delete devices as in the
kernel.

Reviewed by:	imp, markj
Differential Revision:	https://reviews.freebsd.org/D48410
2025-01-10 23:03:32 -05:00
John Baldwin
ee15875c01 stand/kshim: Update for devclass being removed from DRIVER_MODULE
The kshim code abused the devclass argument to DRIVER_MODULE in some
odd ways.  Instead, refactor the devclass handling to more closely
mirror what new-bus does in the kernel by having a linked list of
devclasses looked up by name and associate devices with a devclass.

Devices are now only associated with a module while probing and
attaching.

Reviewed by:	imp, markj
Differential Revision:	https://reviews.freebsd.org/D48409
2025-01-10 23:03:32 -05:00
John Baldwin
4378bd382e stand/kshim: Replace bus_generic_attach with bus_attach_children
Fixes:	18250ec6c0 Replace calls to bus_generic_attach with bus_attach_children
Differential Revision:	https://reviews.freebsd.org/D48404
2025-01-10 23:03:28 -05:00
Emmanuel Vadot
ee233742a5 loader: Rework kernel menu section
With pkgbase we can have long kernel name, so create a new section
for the kernel name.
Do not show the "default" text, we already show the "1 of X" part at
the end of the line and the default kernel is always number 1 so it's a bit
redundant.

Differential Revision:	https://reviews.freebsd.org/D48354
Reviewed by:	imp, tsoome
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2025-01-09 08:13:43 +01:00
Emmanuel Vadot
1b4e117131 loader: Fix orb position
Fix the orb position to be aligned with the menu

Differential Revision:	https://reviews.freebsd.org/D48353
Reviewed by:	imp, tsoome
Sponsored by:	Beckhoff Automation GmbH & Co. KG
2025-01-09 08:13:05 +01:00
Emmanuel Vadot
a0f06dfb0d loader: Add a list of firmware name mapping
Since we started to ship raw firmware for iwm(4), users who loads
the driver from loader are having problems as loader don't know that
the firmwares are now raw files and not kernel modules anymore.
Start a list of default entry for iwm(4) firmwares name mapping so it will
still works when loaded from loader.

Differential Revision:	https://reviews.freebsd.org/D48211
Reviewed by:	bz, imp, kevans
Sponsored by: Beckhoff Automation GmbH & Co. KG
2025-01-06 08:34:02 +01:00
Kyle Evans
48b05b8fc2 loader: set boot_safe when safe mode is selected
This may be used to disable or limit functionality of some services
when safe mode is selected. The particular value of boot_safe should not
be considered significant, only its presence in the environment.

Reviewed by:	imp, tsoome
Differential Revision:	https://reviews.freebsd.org/D32172
2024-12-13 22:31:28 -06:00
Ahmad Khalifa
3f960a05ba loader: remove check for 2M alignment
Instead of listing every arch we support, always define
EFI_STAGING_2M_ALIGN to 1.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1446
2024-12-04 17:19:18 -07:00
Ahmad Khalifa
5e8bd45ffb stand/elf64_freebsd.c: use headers instead of doing things ourselves
Try our best to use headers instead of doing things ourselves. With
i386's headers, there are some holes we need to fill manually.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1446
2024-12-04 17:19:17 -07:00
Ahmad Khalifa
ea0f267c8b stand/efi: move G(x) and M(x) macros to loader_efi.h
These are often needed for copying to the staging area or just general
page table calculations on amd64.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1446
2024-12-04 17:19:17 -07:00
Ahmad Khalifa
a2c48b865e stand: move 'staging' to loader_efi.h
On amd64, we need this to setup the page tables.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1446
2024-12-04 17:19:17 -07:00
Ahmad Khalifa
35cb62e126 kboot/aarch64: remove redundant include
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1446
2024-12-04 17:19:17 -07:00
Ahmad Khalifa
66b9db032b stand: move efi's bi_load into loader_efi.h
For kboot, we still have to declare it manually since we don't always
include loader_efi.h

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1446
2024-12-04 17:19:17 -07:00
Ahmad Khalifa
9e239e67c4 stand: further restrict f_kernphys_relocatable and f_tg_kernel_support
f_tg_kernel_support isn't used by any EFI code, and
f_kernphys_relocatable isn't used by the non-EFI i386 code.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1446
2024-12-04 17:19:17 -07:00
Warner Losh
780f289297 stand: drop inttypes.h from safe list
Nothing uses it anymore, so drop it from the 'safe' list. Also, move
stand/efi/loader/main.c to using machine/_inttypes.h which is all it
really needs.

Sponsored by:		Netflix
2024-11-20 12:49:48 -07:00
Warner Losh
17be774ee7 stand: unistd.h is no longer safe
unistd.h includes too much extra stuff for the boot loader. This creates
a fair amount of namespace pollution and it's best to just make it an
alias for stand.h like the other include files already are.

Sponsored by:		Netflix
2024-11-19 20:35:04 -07:00
Warner Losh
c29cba408d stand: Narrow the 'signal emulation' we provide
We only need to provide sig_atomic_t in emulation. However, including
machine/signal.h brings in too much namespace pollution related to
signals. Instead, define sig_atomic_t as long. Setting long is async
atomic on all platforms (though powerpc64 defines it to an int), though
that doesn't matter since the boot loader doesn't use signals.

Sponsored by:		Netflix
2024-11-19 20:24:41 -07:00
Graham Percival
bc919e81e0 man: Misc syntax fixes
- loader.efi.8: use proper way of printing a backslash.
- usr.bin/gzip/gzip.1: contained a non-breaking space (in utf-8, 0xC2A0).
- lib/libpmc/pmc.*.3: remove two duplicate .Xr lines

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1523
2024-11-14 16:59:22 -04:00
Warner Losh
7e8f87ca2b loader: Don't need the arch list
MK_LOADER_KBOOT is already marked broken for these architectures, so I
don't need an if too.

Sponsored by:		Netflix
2024-11-12 22:01:24 -07:00
Ed Maste
3750ccefb8 Retire MK_PROFILE infrastructure
It was disabled by default in fe52b7f60e.  We planned to (but did not)
remove the option before FreeBSD 14.  Remove it now, for FreeBSD 15.

Relnotes:	Yes
Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31558
2024-11-12 12:11:51 -05:00
Warner Losh
d2434697bc loader.kboot: Build on amd64
But comment out FDT stuff for amd64 built inside kboot. This also
restricts a bit the powerpc platforms we build on to powerpc64.

Sponsored by:		Netflix
2024-11-07 16:23:26 -07:00
Graham Percival
c7c3ef8949 manuals: Remove trailing spaces
This does not change the rendered ascii at all.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1473
2024-11-04 11:26:14 -04:00
Tatiana
47ef2a1310 loader.efi: Fix LOADER_NET_SUPPORT=no builds
We include too many references to networking things in the
non-networking build for loader.efi. Ifdef out netserver command when we
are disabling network support to resolve.

PR: 277528
MFC After: 2 days
Reviewed by: imp
2024-11-02 16:13:58 -06:00
Warner Losh
c2ba66d4d0 loader: Fix boot menu on BIOS
Only the gfx-enabled boot loader supports unicode. Otherwise, we have to
use the old cons25 / ibmpc upper code page drawing characters. Check to
see if we have the gfx.term_drawbox function. If we do, we support the
unicode drawing characters. If we don't, then we have an older loader
that doesn't support it *OR* we have the reduced function, text-only
boot loader. In either of those cases, we need to use the old graphics
characters. Abstract all those details into core.hasUnicode function.

PR: 282465
MFC After: 2 day
Sponsored by: Netflix
Differential Revision:	https://reviews.freebsd.org/D47403
2024-11-02 16:02:44 -06:00
Warner Losh
10c429016a stand: Ugly hack due to default change
So this is a gross hack to fix the 'noclean' build since we changed to
text-only loader. We have to fix it in a better way, but for the moment,
this will fix non-meta no-clean builds. A better hack is to fix this so
we build either vidconsole.c or textvidc.c, but some minor refactoring
and variable renaming is needed.

Fixes:			23dee252da
Sponsored by:		Netflix
2024-10-28 13:51:53 -06:00
Graham Percival
759ddb4d24 manuals: Misc syntax fixes
These were reported by `mandoc -T lint ...` as errors.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com>
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1472
2024-10-28 12:26:03 -03:00
Warner Losh
358752abdf loader/loader.mk: add docs for LOADER_*_SUPPORT variables
These are internal to the loader and generally can only be set in a
makefile that's compiling some variation of loader. Add caveats since
these aren't really user-serviceable parts, though some downstreams will
tweak individual makefiles for their own purposes.

Sponsored by:		Netflix
2024-10-24 20:26:26 -06:00
Warner Losh
23dee252da loader: Change this BIOS tradeoff: Add back zip and use text only
After talking with a number of people about the removal of some things
to make the loader fit, readjust things a little.

Add back GZIP and BZIP2 compression support. Many of the downstream MFC
packaging systems depend on this. This adds back 20k to the size of the
loader.

Make the boot loader text-only by default. This saves 40k in size. Net,
we're 20k smaller. The graphics loader for BIOS is less useful than the
zip functionality: You can still boot w/a text only one it and you can
build a custom one if you really want it. It's also the default we use
for dual console.

This should be merged back into stable/14 and stable/13 so it's in the
next release for each of these. That way we have only one release (13.4)
with the other defaults.

MFC After:		3 days
Sponsored by:		Netflix
Reviewed by:		olce, rgrimes, emaste
Differential Revision:	https://reviews.freebsd.org/D47203
2024-10-24 20:26:25 -06:00
Li-Wen Hsu
dab59af3bc
Canonicalize the name of the FreeBSD Foundation
Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
2024-10-24 05:03:07 +08:00
Warner Losh
ef48b2954e stand: Fix defaults file
Currently, quotes in a comment lead to mal-formed lines warnings. Remove
the quotes since it doesn't matter. The underlying bug likely should be
fixed, but since stability week is neigh, workaround this.

Fixes:			7df3e400ea
Sponsored by:		Netflix
Reviewed by:		bcran
Differential Revision:	https://reviews.freebsd.org/D47201
2024-10-19 12:53:41 -06:00
Graham Percival
229381deb2 manuals: Misc syntax fixes
These were reported by `mandoc -T lint ...` as errors.

The rendered output (in ascii and html) is not affected by this commit.

Signed-off-by:	Graham Percival <gperciva@tarsnap.com>
Reviewed by:	mhorne
MFC after:	3 days
Sponsored by:	Tarsnap Backup Inc.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1459
2024-10-15 17:20:47 -03:00
Warner Losh
501983e62e loader.efi: Parse SPCR v3 and v4
We can get the UART clock from v3 SPCR, and a precise baudrate from
v4. Some precise baudrates will currently be rejected by the kernel.

Sponsored by:		Netflix
Reviewed by:		adrian, andrew
Differential Revision:	https://reviews.freebsd.org/D47096
2024-10-15 05:12:59 -06:00
Warner Losh
70253b538f loader.efi: Parse SPCR table entry in ACPI tables
If there's a SPCR, then use it to create and pass the right values to
the uart.  We pass xo=0 in to calcuate the xo from the baud rate. We try
to be smart about what we set. We either set io or mm or pv/pd. Old
kernels will still work, despite pb/pd not being supported, because
we'll fall back to the SPCR parsing in the kernel.

We don't support Rev3 or Rev4 SPCR yet. It's too new to be in real
hardware yet.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D47085
2024-10-15 05:12:16 -06:00
Warner Losh
94164106c0 loader.efi: |= the boot flags how
how is assumed to be 0, so we directly assign to it. It might not always
be 0, so or-in these bits.

Sponsored by:		Netflix
Reviewed by:		bz, andrew
Differential Revision:	https://reviews.freebsd.org/D47084
2024-10-15 05:11:02 -06:00
Warner Losh
c5f3a7f622 loader.efi: Make rsdp global
Make rsdp pointer to the RSDP global so we can look up other tables.

Sponsored by:		Netflix
Reviewed by:		andrew
Differential Revision:	https://reviews.freebsd.org/D47083
2024-10-15 05:10:27 -06:00