Commit Graph

279302 Commits

Author SHA1 Message Date
Andrew Turner
754358108c Include sys/systm.h in phy_usb.c for KASSERT
Rather than depending on header pollution include systm.h directly.

Sponsored by:	Innovate UK
2022-10-28 18:31:55 +01:00
Andrew Turner
8724dd26d4 Allow clk_fixed.c to be built without FDT
Include opt_platform.h to get the FDT definition and only include FDT
headers when FDT is defined.

Sponsored by:	Innovate UK
2022-10-28 18:31:55 +01:00
Andrew Turner
83de695791 Remove unneeded headers from clk_link.c
There is no OFW/FDT specific code in this file so the ofw headers can
be removed.

Sponsored by:	Innovate UK
2022-10-28 18:31:55 +01:00
Mitchell Horne
701923e2a4 riscv: improve parsing of riscv,isa property strings
This code was originally written under the assumption that the ISA
string would only contain single-letter extensions. The RISC-V
specification has extended its description of the format quite a bit,
allowing for much longer ISA strings containing multi-letter extension
names.

Newer versions of QEMU (7.1.0) will append to the riscv,isa property
indicating the presence of multi-letter standard extensions such as
Zfencei. This triggers a KASSERT about the expected length of the
string, preventing boot.

Increase the size of the isa array significantly, and teach the code
to parse (skip over) multi-letter extensions, and optional extension
version numbers. We currently ignore them completely, but this will
change in the future as we start supporting supervisor-level extensions.

MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36601
2022-10-28 13:28:08 -03:00
Jung-uk Kim
5723d13811 acpica: Fix the botched merge
Fixes:		9a4bc5208f acpica: Import ACPICA 20221020
2022-10-27 22:36:35 -04:00
Jung-uk Kim
19ee8335c5 acpica: Merge ACPICA 20221020 2022-10-27 22:04:32 -04:00
Jung-uk Kim
9a4bc5208f acpica: Import ACPICA 20221020
(cherry picked from commit a799bdd9d50e84cd6a36e8f1d2ac4301b2a6b374)
2022-10-27 22:03:50 -04:00
Olivier Houchard
d78c2cd831 arm64: Implement cpu_ptrace().
Add a minimal implementation of cpu_ptrace() for arm64. It is only used to
get/set VFP registers for 32bits binaries, as it is apparently what we use
there, instead of the MI PT_GETFPREGS/PT_SETFPREGS.

PR:	267361
MFC After: 1 week
2022-10-27 23:25:56 +02:00
Dag-Erling Smørgrav
473e9fcab4 script: Handle a missing 's' stamp gracefully.
Sponsored by:	Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37182
2022-10-27 20:11:36 +00:00
Dag-Erling Smørgrav
6ac087cf8f script: Further usage string nits.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D37177
2022-10-27 19:49:18 +00:00
Dag-Erling Smørgrav
3276866f40 script: Use size_t / ssize_t where needed.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D37177
2022-10-27 19:49:18 +00:00
Warner Losh
8e9a651acb hyperv: Don't build on 32-bit arm
Sponsored by:		Netflix
2022-10-27 13:18:52 -06:00
Andrew Turner
49750143c1 Add a LINT-ACPI arm64 config
To ensure a kernel with only ACPI builds add a LINT file with FDT
disabled.

Sponsored by:	The FreeBSD Foundation
2022-10-27 18:59:33 +01:00
Andrew Turner
701ab6dba4 Stop building FDT-only modules in an ACPI only kernel
When building a kernel without FDT these modules don't build. As they
depend on FDT and don't work with ACPI disable them.

Reviewed by:	imp, kevans
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37178
2022-10-27 18:59:33 +01:00
Warner Losh
02dba4f75f kboot: Add hostfs
Add hostfs for the Linux environment. We can't use the userboot one
that's kinda similar because the Linux system calls we have in kboot are
not quite POSIX compliant (Linux takes care of providing the POSIX
interface in libc), so we have to cope with a number of quirks in that
area.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D36607
2022-10-27 11:37:54 -06:00
Warner Losh
cc9f1b4c35 stand/kboot: Make FDT fixup per-arch
The fixups needed vary somewhat by architecture, so move the FDT fixup
to be per-arch. Rename the fdt_linux_fixup() routine to be
fdt_arch_fixup() and expect all architecutres to fix things up as
needed.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D36604
2022-10-27 11:36:51 -06:00
Warner Losh
1d21f64149 bhyve: Implement MSR_MISC_FEATURES_ENABLES
Linux reads MISC_FEATURES_ENABLES to manage the CPUID faulting feature
(undocumented in the Intel SDM, but documented in 323850-004 (Intel
Virtualization Technology FlexMigration Application Note). Since bhyve
doesn't emulate this feature, we always return 0. Neither does bhyve
support the MONITOR/MWAIT fault bit also in this MSR (which is
documented in the sdm), so always return 0.

Sponsored by:		Netflix
Reviewed by:		jhb
Differential Revision:	https://reviews.freebsd.org/D36602
2022-10-27 11:34:41 -06:00
Math Ieu
172be8642d split: reset errno prior to getline()
Something else may have set errno, breaking the post-getline() logic
that tries to detect the getline() error.  This was initially noted in
a jail on a system that has HPET, in a jail that does not expose
/dev/hpet0 -- we see an earlier error in libc's vdso bits.

Fixes:	5c053aa3c5 ("split: switch to getline() [...]")
2022-10-27 12:17:59 -05:00
Andrew Turner
ff270fce16 Make sure error is defined in dpaa2
The error variable is used in both the ACPI and FDT paths. Declare it
unconditionally.

Sponsored by:	The FreeBSD Foundation
2022-10-27 18:03:32 +01:00
Ed Maste
c8113dad7e Increase MAX_APIC_ID safeguard to 0x800
MAX_APIC_ID must be at least twice MAXCPU.  Increase it to 0x800 so that
it is possible to set MAXCPU to 512 or 1024 in a custom kernel config
file.

Note that increasing this limit does not itself cause any allocations
to be larger; it just allows madt_parse_cpu() to process higher APIC
IDs.

APIC IDs may be sparse and so we can waste memory.  This is independent
of this change, but becomes more of an issue as the maximum APIC ID
grows.  This should be addressed with future work.

Reviewed by:	royger
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D37067
2022-10-27 12:33:34 -04:00
Andrew Turner
64c3edc237 Allow the extres regulator code to build without FDT
This allows drivers that use this to build in an ACPI only kernel.

Sponsored by:	The FreeBSD Foundation
2022-10-27 17:28:56 +01:00
Andrew Turner
16625cabab Only build if_mvneta.c when FDT is defined
This is only ever used by a FDT specific attachment and calls into
FDT specific functions. Only build it when FDT is in the kernel config.
Sponsored by:	The FreeBSD Foundation
2022-10-27 17:21:02 +01:00
Andrew Turner
91e2614a71 Fix xdma_if.m in an ACPI only kernel
- We depend on header polution to include sys/malloc.h. Include it
   directly.
 - Only define FDT-specific fuctions when building a FDT kernel.

Sponsored by:	Innovate UK
2022-10-27 17:17:20 +01:00
Andrew Turner
7b43fba03a Mark FDT only drivers as such
These drivers have FDT bindings, but not ACPI. Mark them as FDT only
to help a no-FDT LINT kernel build.

Sponsored by:	The FreeBSD Foundation
2022-10-27 17:06:15 +01:00
Andrew Turner
7ddba690f8 Remove an unneeded cpu_dcache_wb_range from arm64
The cpu_dcache_wb_range function is an expensive function that is
unneeded in ddb. It is used when the cache needs to be written to RAM,
e.g. when working with a non-cache coherent device.

Remove it as cpu_icache_sync_range already has the needed d-cache
handling to ensure any changed memory is visible to the i-cache.

Reviewed by:	imp
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37037
2022-10-27 17:05:46 +01:00
Kyle Evans
60c96dbf20 arm64: add a std.ec2 config
Mostly to document basic harware present on the platform; knowing that
Graviton exposes an ns8250 uart alone is quite helpful.

Reviewed by:	andrew, imp, manu
Seems accurate:	cperciva
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D36776
2022-10-27 10:39:55 -05:00
Ed Maste
43d0c2ddd2 netlink: use (void) for function definitions with no arguments
For some of these Clang produced a warning that "a function declaration
without a prototype is deprecated in all versions of C".  In other cases
the function defintion used () which did not match the header
declaration, which used (void).

Sponsored by:	The FreeBSD Foundation
2022-10-27 11:14:00 -04:00
Mark Johnston
ae71263c66 bhyve: Remove an unused parameter from pci_nvme_append_iov_req()
No functional change intended.

MFC after:	1 week
Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D37116
2022-10-27 10:48:55 -04:00
Mark Johnston
a309ad7bd1 bhyve: Fix an apparent pointer arithmetic bug in the xhci emulation
Also remove the out-parameter of pci_xhci_find_stream(), since it's
unused by all callers.

MFC after:	1 week
Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D37118
2022-10-27 10:48:55 -04:00
Mark Johnston
04336c0562 bhyve: Make sure that the VNC version is initialized
clang warned that "client_ver" can be left uninitialized.  This change
causes the new connection to be dropped if a version string is not
presented.

MFC after:	1 week
Reviewed by:	jhb
Differential Revision:	https://reviews.freebsd.org/D37117
2022-10-27 10:48:55 -04:00
Dag-Erling Smørgrav
e7c13cf438 script: Add usage string for playback mode.
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D37138
2022-10-27 14:46:15 +00:00
Dag-Erling Smørgrav
8e096e24d4 script: Correct -F in man page and usage string.
Sponsored by:	Klara, Inc.
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D37138
2022-10-27 14:46:09 +00:00
Souradeep Chakrabarti
9729f076e4 arm64: Hyper-V: enablement for ARM64 in Hyper-V (Part 3, final)
This is the last part for ARM64 Hyper-V enablement. This includes
commone files and make file changes to enable the ARM64 FreeBSD
guest on Hyper-V. With this patch, it should be able to build
the ARM64 image and install it on Hyper-V.

Reviewed by:	emaste, andrew, whu
Tested by:	Souradeep Chakrabarti <schakrabarti@microsoft.com>
Sponsored by:	Microsoft
Differential Revision:	https://reviews.freebsd.org/D36744
2022-10-27 13:53:22 +00:00
Peter Holm
9349fc283b stress2: Added a newfs(8) test scenario 2022-10-27 09:59:16 +02:00
Peter Holm
e23445275a stress2: Added a regression test for a ffs validate_sblock() fix 2022-10-27 09:57:57 +02:00
Xin LI
07dfb236c8 MFV: Restore the ability to process files from stdin immediately.
PR:		bin/267221
MFC after:	3 days
2022-10-27 00:12:53 -07:00
Christos Zoulas
5d5531f83b Use the -n flag to produce immediate results and kill the short-lived -I.
(cherry picked from commit 425f9897f0ed791a6c216c24375bd9b3a42330a2)
2022-10-27 00:10:55 -07:00
Christos Zoulas
d5e82a1bb0 In immediate mode, print with the current width.
(cherry picked from commit 7d489233e5f27decdbcfb0e8ecba0b0b5fdc6066)
2022-10-27 00:10:35 -07:00
Christos Zoulas
ac428f59cd PR/397: dadv: Restore the ability of processing filenames from stdin
immediately, using the -I flag.

(cherry picked from commit ae5c1ff8df0d6e00cbf5e31875d777edbb88d60a)
2022-10-27 00:10:11 -07:00
Kyle Evans
866beaa0aa psci: set psci_present as early as possible
psci_attach is way too late to provide the intended semantics for
psci_present.  psci calls can be made immediately after psci_init(),
called way earlier at SI_SUB_CPU + SI_ORDER_FIRST, and we need it to
be valid as early as we can possibly call a psci function.

This fixes booting RPi3+4 with the in-review spintable patch;
rpi3-psci-monitor patches the FDT to add a PSCI node, but it doesn't
patch each cpus' enable-method.  Because of this, we would stall the
boot while enabling CPU 1 as we saw a valid looking enable-method and
"no" functional PSCI and attempted to use the spintable rather than
simply not starting secondary APs.

Fixes:	2218070b2c ("psci: finish psci_present implementation")
Reported by:	karels
2022-10-26 23:22:23 -05:00
Konstantin Belousov
017367c114 ffs validate_sblock(): avoid 32bit mul overflow
Reported by:	soralx@cydem.org
Tested by:	pho
Reviewed by:	mckusick
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2022-10-27 06:17:38 +03:00
Jason A. Harmening
f7833196bd vfs_lookup(): Minor performance optimizations
Refactor the symlink and mountpoint traversal logic to avoid
repeatedly checking the vnode type; a symlink cannot be a mountpoint
and vice versa.  Avoid repeatedly checking cn_flags for NOCROSSMOUNT
and simplify the check which determines whether the vnode is a
mountpoint.

Suggested by:	mjg
Reviewed by:	kib
Tested by:	pho
Differential Revision:	https://reviews.freebsd.org/D35054
2022-10-26 19:33:33 -05:00
Jason A. Harmening
4390622c8d vfs_busy(): fix wording in comment
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D35054
2022-10-26 19:33:30 -05:00
Jason A. Harmening
706f15c5fa Remove witness directives from crossmp locking VOPs
These are of limited use since the crossmp vnode locking ops have not
actually used a lock since commit
a2d3554542.  We in fact require that
these operations are always issued with LK_SHARED.  Additionally,
these directives can produce a false positive in certain VV_CROSSLOCK
cases which require upgrading of the covered vnode lock from shared
to exclusive.

While here, replace the runtime check of LK_SHARED with a KASSERT and
expand the check to include LK_NOWAIT, which all callers pass.

Reviewed by:	kib
Tested by:	pho
Differential Revision:	https://reviews.freebsd.org/D35054
2022-10-26 19:33:18 -05:00
Jason A. Harmening
080ef8a418 Add VV_CROSSLOCK vnode flag to avoid cross-mount lookup LOR
When a lookup operation crosses into a new mountpoint, the mountpoint
must first be busied before the root vnode can be locked. When a
filesystem is unmounted, the vnode covered by the mountpoint must
first be locked, and then the busy count for the mountpoint drained.
Ordinarily, these two operations work fine if executed concurrently,
but with a stacked filesystem the root vnode may in fact use the
same lock as the covered vnode. By design, this will always be
the case for unionfs (with either the upper or lower root vnode
depending on mount options), and can also be the case for nullfs
if the target and mount point are the same (which admittedly is
very unlikely in practice).

In this case, we have LOR. The lookup path holds the mountpoint
busy while waiting on what is effectively the covered vnode lock,
while a concurrent unmount holds the covered vnode lock and waits
for the mountpoint's busy count to drain.

Attempt to resolve this LOR by allowing the stacked filesystem
to specify a new flag, VV_CROSSLOCK, on a covered vnode as necessary.
Upon observing this flag, the vfs_lookup() will leave the covered
vnode lock held while crossing into the mountpoint. Employ this flag
for unionfs with the caveat that it can't be used for '-o below' mounts
until other unionfs locking issues are resolved.

Reported by:	pho
Tested by:	pho
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D35054
2022-10-26 19:33:03 -05:00
John Baldwin
769b884e2e vmm: Fix AP startup with old userspace binaries.
Older binaries that do not request IPI exits to userspace do not
start user threads for other vCPUs until a STARTUP IPI triggers a
VM_EXITCODE_SPINUP_AP exit to userland.  This means that those vcpus
are not yet active (in terms of vm_active_cpus) when the INIT and
STARTUP IPIs are delivered to the vCPUs.

The changes in commit 0bda8d3e9f changed the INIT and STARTUP IPIs
to reuse the existing vlapic_calcdest() function.  This function
silently ignores IPIs sent to inactive vCPUs.  As a result, when using
an old bhyve binary, the INIT and STARTUP IPIs sent to wakeup APs were
ignored.

To fix, restructure the compat code for the INIT and STARTUP IPIs to
ignore the results of vlapic_calcdest() and manually parse the APIC ID
and resulting vcpuid.  As part of this, make the compat code always
conditonal on the ipi_exit capability being disabled.

Reviewed by:	c.koehne_beckhoff.com, markj
Differential Revision:	https://reviews.freebsd.org/D37093
2022-10-26 14:22:56 -07:00
Ed Maste
8aa64f3073 UPDATING: correct spearate typo
Reported by:	manu
Fixes:		9c36300582 ("UPDATING: add an introductory...")
2022-10-26 14:25:12 -04:00
Ed Maste
9c36300582 UPDATING: add an introductory sentence to 20221026's entry 2022-10-26 14:18:29 -04:00
Emmanuel Vadot
5575454d7c UPDATING: Add note for pkgbase users after splitting packages. 2022-10-26 19:48:32 +02:00
Emmanuel Vadot
069ebe6fba pkgbase: Put less in FreeBSD-runtime
Useful to have a pager in it.

Differential Revision:	https://reviews.freebsd.org/D36231
2022-10-26 19:46:43 +02:00