Commit graph

289551 commits

Author SHA1 Message Date
Mitchell Horne 3fb8f1272b riscv: add firmware partitions to GENERICSD.conf
Create two partitions in the existing space at the beginning of the
image (8MB). These are intended to hold u-boot SPL and u-boot proper.

The partition types selected are compatible with SiFive boards, e.g. the
HiFive Unmatched. They can easily be overridden for a platform that uses
the same scheme but different partition types, e.g. the StarFive
VisionFive v2. Firmware is not actually installed, this too is left for
the user.

It is not as simple to create the firmware partitions after the fact,
e.g. with partition indices 3 and 4. It is a shortcoming of current day
u-boot that the SPL loader looks for a specific partition index, rather
than the partition type, meaning that we will fail to boot if partition
2 doesn't contain u-boot.

Thus, our GENERICSD images become more generically usable with current
RISC-V hardware/firmware platforms.

Reviewed by:	manu, karels, imp
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D43849
2024-02-14 11:16:54 -04:00
Mitchell Horne 2af03ebfb8 release: make SD card partition layout more flexible
Currently the partition layout is hardcoded to create an EFI/FAT
partition and a UFS root partition, with some logic to handle GPT/MBR
differences.

On RISC-V platforms we are seeing the emerging pattern that firmware
should be placed in a partition of a known type, rather than just a
known sector of the disk. Thus, some functionality is needed to
customize the layout for SD card images.

Add a hook, arm_create_partitions(), which can be overridden to insert
additional platform-specific partitions, possibly preceding the standard
EFI and UFS ones. A couple of new variables are added to track the
indices, e.g. ROOTFSPART_SUFFIX=p2.

In a couple places this de-duplicates the GPT/MBR logic.

Reviewed by:	manu, karels, imp
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D43848
2024-02-14 11:16:54 -04:00
Mitchell Horne 94b86c12f1 release: de-duplicate arm.subr fstab logic
These days, the entries are the identical for GPT and MBR.

Reviewed by:	manu, karels, imp
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D43847
2024-02-14 11:16:54 -04:00
Mark Johnston f48cd806e0 build: Do not run ctfconvert on VDSO files
Reviewed by:	emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D43877
2024-02-14 09:57:38 -05:00
Florian Walpen 2198221bd9
sched_setscheduler(2): Change realtime privilege check
Check for privilege PRIV_SCHED_SETPOLICY instead of PRIV_SCHED_SET, to
at least make it coherent with what is done at thread creation when
a realtime policy is requested, and have users authorized by
mac_priority(4) pass it.

This change is good enough in practice since it only allows 'root' (as
before) and mac_priority(4)'s authorized users in (the point of this
change), without other side effects.  More changes in this area, to
generally ensure that all privilege checks are consistent, are going to
come as olce's priority revamp project lands.

(olce: Expanded the explanations.)

PR:                     276962
Reported by:            jbeich
Reviewed by:            olce
Approved by:            emaste (mentor)
MFC after:              3 days
Differential Revision:  https://reviews.freebsd.org/D43835
2024-02-14 15:24:11 +01:00
Christopher Davidson bbd29c4394 wlan(4) - remove an(4) reference
Fixes: 663b174b5b ("an: Remove driver")
Pull request: https://github.com/freebsd/freebsd-src/pull/1120
2024-02-14 09:11:00 -05:00
Richard Scheffenegger fcea1cc971 tcp: fix RTO ssthresh for non-6675 pipe calculation
Follow up on D43768 to properly deal with the non-default
pipe calculation. When CC_RTO is processed, the timeout
will have already pulled back snd_nxt. Further, snd_fack
is not pulled along with snd_una.

Reviewed By:		tuexen, #transport
Sponsored by:		NetApp, Inc.
Differential Revision:	https://reviews.freebsd.org/D43876
2024-02-14 14:51:53 +01:00
Cy Schubert b76ef9a7cb unbound: Vendor import 1.19.1
Release notes at
    https://www.nlnetlabs.nl/news/2024/Feb/13/unbound-1.19.1-released/

Security:	CVE-2023-50387, CVE-2023-50868
MFC after:	3 days
2024-02-13 21:05:50 -08:00
Cy Schubert 217a625642 unbound: Vendor import 1.19.1
Release notes at
    https://www.nlnetlabs.nl/news/2024/Feb/13/unbound-1.19.1-released/
2024-02-13 20:54:33 -08:00
Mark Johnston 53fba3b984 build: Default to DWARF4 in the kernel
gcc 12 defaults to emitting DWARF 5, but this is not yet supported by
our libdwarf and thus by ctfconvert.

Reviewed by:	emaste, imp
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D43837
2024-02-13 17:51:09 -05:00
Dag-Erling Smørgrav 46c599340f Update tzcode to 2024a.
MFC after:	3 weeks
Sponsored by:	Klara, Inc.
2024-02-13 21:31:41 +01:00
Dag-Erling Smørgrav 378c74faf3 Import tzcode 2024a 2024-02-13 19:30:52 +01:00
Edward Tomasz Napierala b4b61ead7e dot.profile: handle symlinked $HOME
Reapply 4cea05a273:

    Make sh(1) recognize the default $HOME.  By default /home
    is a symlink; without this change, when you log in, sh(1)
    won't realize the current directory (eg '/usr/home/test')
    is the same as $HOME ('/home/test').

/home is no longer a symlink by default, but new users may be added on
systems that started out with an earlier version of FreeBSD (and still
have /home as a symlink) or admins may do so.

This test is not particularly expensive, so just restore it.

Suggested by:	danfe, brooks
2024-02-13 13:24:22 -05:00
Dan Kotowski 9cc816c255 Fix typo in da flags reporting
ANNOUCNED -> ANNOUNCED

Reviewed by:		imp
Differential Revision:	https://reviews.freebsd.org/D41948
2024-02-13 10:44:59 -07:00
Chuck Silvers fd24a63a38 x86/ucode: add const where appropriate
Sponsored by:   Netflix
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D43865
2024-02-13 08:18:06 -08:00
Kyle Evans c5796f1572 rtld: add some dlopen tests
dlopen_basic just tests that libthr.so can be dlopen()ed, which will
just serve as a sanity check that "libthr.so" is a thing that can be
dlopened in case we get a weird failure in dlopen_recursing.

dlopen_recursing tests a regression reported after the libsys split,
where some dlopen() may cause infinite recursion and a resulting crash.
This case is inspired by bdrewery's description of what seemed to be
causing his issue.

The corresponding fix landed in commit
968a18975a ("rtld: ignore load_filtees() calls if we already [...]")

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D43859
2024-02-13 09:38:02 -06:00
Konstantin Belousov 968a18975a rtld: ignore load_filtees() calls if we already loading filtees for the obj
in addition to avoiding it for already loaded filtees. Issue is that
during load, rtld needs to resolve some special ABI symbols, like
executable stack fixer and static TLS initializer, which might trigger
recursion.

Example is libthr which is filter for libsys, and which exports
__pthread_distribute_static_tls.

Tested by:	kevans, krion
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D43858
2024-02-13 16:24:01 +02:00
Konstantin Belousov 30b5f6b33b rtld load_filtees(): reindent and reduce block nesting
Reviewed by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D43858
2024-02-13 16:23:55 +02:00
Konstantin Belousov 9ea864b54b rtld symlook_obj: move common code to check filtees into helper
Revieved by:	markj
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D43858
2024-02-13 16:23:41 +02:00
Andrew Turner 69e4b35eb3 arm: Add EARLY_PRINTF and SOCDEV_PA/VA to NOTES
This ensures they are build tested.

Sponsored by:   Arm Ltd
2024-02-13 11:48:53 +00:00
Andrew Turner a9fc9d6d15 dev/uart: Support 8-byte register access
While we only support 4-byte registers in the uart code the physical
access may be to an 8-byte register. Support this as an option on
non-i386. On i386 we lack the needed 8-byte bus_space functions.

ACPI has an option for 8-byte register io width, and FDT can be given
any size. Support these sizes, even if we don't expect to see hardware
with an 8-byte io width.

Reviewed by:	imp
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D43374
2024-02-13 11:48:53 +00:00
Andrew Turner b889b90adb arm64: Add EARLY_PRINTF and SOCDEV_PA to NOTES
This ensures they are build tested.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D43364
2024-02-13 11:48:53 +00:00
Andrew Turner 53391af151 dev/uart: Support the pl011 uart in hw.uart.console
Add the pl011 uart to the list of supported uarts for use by
hw.uart.console. This is commonly found in Arm based devices, and a
variant is standardised in the Arm SBSA.

Reviewed by:	imp
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D43363
2024-02-13 11:48:52 +00:00
Andrew Turner eae36de826 dev/uart: Support setting the register io width
Some uarts require a specific register width. Support setting this in
the kernel environment.

Reviewed by:	imp (earlier version)
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D43362
2024-02-13 11:48:52 +00:00
Andrew Turner 949670f8f4 dev/uart: Use a linker set to find uart classes
When the uart is configured via the environment we need to find the
uart class with a specified name. Currently to do this with an
incomplete list of uarts. As we may not have included all uarts in the
kernel each class is defined as weak.

Switch to a linker set so the list is always up to date based on what
is included in the kernel, and the class can be static.

Reviewed by:	imp
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D43361
2024-02-13 11:48:52 +00:00
Andrew Turner 202890922e sys: Simplify enabling EARLY_PRINTF uarts
Support selecting the early uart with "options EARLY_PRINTF=foo" in
the kernel configuration file. This allows us to not have to change
source files when enabling EARLY_PRINTF, simplifying enabling it.

New uart drivers can be enabled by defining a new early_printf_foo
value to be unique, then using "#if CHECK_EARLY_PRINTF(foo)" to decide
when to enable the uart.

While here add pl011 early printf support.

Reviewed by:	imp (earlier version)
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D43360
2024-02-13 11:48:52 +00:00
Andrew Turner 639a626b40 arm: Clean up socdev_va
Support socdev_va on arm and ensure the variable is available on arm64.

Reviewed by:	imp
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D43359
2024-02-13 11:48:52 +00:00
Chia-Jung Chang 90405e1d63
domainname(1): Grammar fix
Event:		Advanced UNIX programming course (Fall'23) at NTHU
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1038
2024-02-13 19:13:33 +08:00
Chia-Jung Chang 26cf4a61f6
hostname(1): Grammar fix
Event:		Advanced UNIX programming course (Fall'23) at NTHU
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1037
2024-02-13 19:02:17 +08:00
Chia-Jung Chang 8e9fc2d9f6
date(1): Grammar fixes
Event:		Advanced UNIX programming course (Fall'23) at NTHU
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1035
2024-02-13 19:00:59 +08:00
Chia-Jung Chang 416fdc2d71
cp(1): Grammar fix in comment
Event:		Advanced UNIX programming course (Fall'23) at NTHU
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1033
2024-02-13 18:53:50 +08:00
Chia-Jung Chang 304f52ad1b
df(1): Fix grammar
Event:		Advance UNIX programming course (Fall'23) at NTHU
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1027
2024-02-13 18:31:05 +08:00
Chia-Jung Chang a400e25904
ed(1): Fix grammar in comment
Event:		Advanced UNIX programming course (Fall'23) at NTHU
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1025
2024-02-13 17:55:54 +08:00
Wei Hu 47e99e5bc5 mana: fix leaking pci resource problem detaching mana deivces
Fixing the error messages when detaching the mana gdma devices
showed in dmesg: "Device leaked memory resources".

Reported by:	NetApp
MFC after:	3 days
Sponsored by:	Microsoft
2024-02-13 09:38:31 +00:00
HUANG,YU-JIA b00271ceea
growfs(8): Grammar fix
Event:		Advanced UNIX Programming Course (Fall'23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1056
2024-02-13 17:05:18 +08:00
HUANG,YU-JIA 26c3d72eca
growfs(8): Fix spelling
Event:		Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1055
2024-02-13 17:03:40 +08:00
Ting-Hsuan Huang 2a3a8eb9fa
libusb(3): Fix link in comment
Event:		Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1042
2024-02-13 16:55:54 +08:00
Cheng-Yuan Wu 38b7eebc4a
libbsdstat: Fix typo in bsdstat.h
Event:		Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1040
2024-02-13 16:53:35 +08:00
Cheng-Yuan Wu f446c9482c
libbe(3): Fix typo and grammar
Event:		Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1039
2024-02-13 16:52:35 +08:00
Yi-Chen Li d3905a3b07
dmesg(8): Fix typo timetamps -> timestamps
Event:		Advanced UNIX Programming Course (Fall'23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1036
2024-02-13 16:42:49 +08:00
Yi-Chen Li 7a71b35023
devmatch(8): Grammar fix
Event:		Advanced UNIX Programming Course (Fall'23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1034
2024-02-13 16:41:32 +08:00
Yi-Chen Li e8289f82c0
comcontrol(8): Grammar fix
Event:		Advanced UNIX Programming Course (Fall'23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1032
2024-02-13 16:40:09 +08:00
Yi-Chen Li c407d351df
ccdconfig(8): Minor grammar fix
Event:		Advanced UNIX Programming Course (Fall'23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1031
2024-02-13 16:38:57 +08:00
Yi-Chen Li 9977fb8042
camcontrol(8): Fix grammar: a ATA -> an ATA
Event:		Advanced UNIX Programming Course (Fall'23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1030
2024-02-13 16:37:21 +08:00
Yi-Chen Li 31f6889564
rcorder(8): Fix grammar
Event:		Advanced UNIX Programming Course (Fall'23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1029
2024-02-13 16:36:05 +08:00
Yi-Chen Li b287f26c3f
setkey(8): Grammar fix: a FQDN -> an FQDN
Event:		Advanced UNIX Programming Course (Fall'23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1024
2024-02-13 16:12:39 +08:00
Jui-Hsuan Chang c8e7649b99
veriexec(8): Fix typo
Event:		Advanced UNIX Programming Course (Fall’23) at NTHU.
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1018
2024-02-13 16:11:30 +08:00
Cheng-Hsun Lin 1d479bf6b4
gjournal(8): standardize capitalization for consistency
Event:		Advanced UNIX Programming Course (Fall'23) at NTHU
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1017
2024-02-13 16:09:35 +08:00
LO WEN-CHIEN 49eeca743b
stat(1): Fix grammar error in stat.c
Event:		Advanced UNIX Programming Course (Fall’23) at NTHU
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1014
2024-02-13 15:33:16 +08:00
LO WEN-CHIEN b1d0cf28ff
ar(1): Fix grammar error in write.c
Event:		Advanced UNIX Programming Course (Fall’23) at NTHU
Pull Request:	https://github.com/freebsd/freebsd-src/pull/1013
2024-02-13 15:31:59 +08:00