Commit Graph

279063 Commits

Author SHA1 Message Date
John Baldwin
744bfb2131 Import the WireGuard driver from zx2c4.com.
This commit brings back the driver from FreeBSD commit
f187d6dfbf plus subsequent fixes from
upstream.

Relative to upstream this commit includes a few other small fixes such
as additional INET and INET6 #ifdef's, #include cleanups, and updates
for recent API changes in main.

Reviewed by:	pauamma, gbe, kevans, emaste
Obtained from:	git@git.zx2c4.com:wireguard-freebsd @ 3cc22b2
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36909
2022-10-28 13:36:12 -07:00
John Baldwin
9e0aaedd70 Split netinet shell tests into one per line.
This makes diffs when adding or removing tests easier to read.

While here, sort the list of tests.

Reviewed by:	kevans, melifaro, asomers, markj, emaste
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36908
2022-10-28 13:36:12 -07:00
Warner Losh
31bfa27894 sys/modules: Catchup to armv[45] being removed
Now that armv[45] are removed, simplify some tests for armv[67] that are
now either always true, or always true when we're on arm.

Sponsored by:		Netflix
2022-10-28 14:11:04 -06:00
Warner Losh
c8a63d71fe sys/modules: Delete now empty if
Ah, the joys of pushing a commit with a dirty editor buffer that all the
checks in git didn't catch... Also, my eyeballs missed it too :(.

Fixes:		ba9f71ddec
Noticed by:	jrtc27
Sponsored by:	Netflix
2022-10-28 14:10:09 -06:00
Colin Percival
5ad8c32c72 ns8250: Fix sense of LSR_TEMT FCR check
When flushing the UART, we need to drain manually if LSR_TEMT is
*not* asserted, aka. if the transmit FIFO is not empty.

Reported by:	void <void@f-m.fm>
Fixes:		c4b68e7e53 "ns8250: Check if flush via FCR succeeded"
Differential Revision:	https://reviews.freebsd.org/D37185
2022-10-28 12:20:28 -07:00
Warner Losh
ba9f71ddec sys/modules: simplify a little by moving syscons to x86 only
syscons is x86 only now that sparc has been retired. No need for the
extra if. Also alphabetize p2sb.

Sponsored by:		Netflix
2022-10-28 11:52:40 -06:00
Warner Losh
445875aefd sys/modules: tidy up a bit by moving _hyperv to aarch64 section
Suggested by:	jhb
Sponsored by:	Netflix
2022-10-28 11:46:48 -06:00
Andrew Turner
227046a4d2 Enable more extres options when FDT is missing
These now build when FDT is not included in the kernel config.

Sponsored by:	Innovate UK
2022-10-28 18:31:56 +01:00
Andrew Turner
5566f84822 Only include regdev_if.h when it's needed
We don't need to include regdev_if.h when not building for FDT.

Sponsored by:	Innovate UK
2022-10-28 18:31:55 +01:00
Andrew Turner
01aaff6d1c Fix the includes in regulator_fixed.c
Include sys/bus.h directly rather than depend on header pollution.
While here fix the order of sys/systm.h.

Sponsored by:	Innovate UK
2022-10-28 18:31:55 +01:00
Andrew Turner
78e60ba04a Only include phydev_if.h when needed
We only need to include phydev_if.h in phy.c when FDT is enabled and
don't need it at all in phy_usb.c.

Sponsored by:	Innovate UK
2022-10-28 18:31:55 +01:00
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