]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
18 months agocontrib/tzdata: import tzdata 2022f
Philip Paeps [Sat, 29 Oct 2022 02:38:01 +0000 (10:38 +0800)]
contrib/tzdata: import tzdata 2022f

Changes: https://github.com/eggert/tz/blob/2022f/NEWS

MFC after: 3 days

18 months agoImport tzdata 2022f
Philip Paeps [Sat, 29 Oct 2022 02:33:53 +0000 (10:33 +0800)]
Import tzdata 2022f

18 months agoddb: print the actual syscall name
Mitchell Horne [Fri, 28 Oct 2022 21:20:05 +0000 (18:20 -0300)]
ddb: print the actual syscall name

Some architectures will pretty-print a system call trap in the
backtrace. Rather than printing the symbol, use the syscallname()
function to pull the string from the sv_syscallnames array corresponding
to the process. This simplifies the function somewhat.

Mostly, this will result in dropping the "sys" prefix, e.g. "sys_exit"
will now be printed simply as "exit".

Make two minor tweaks to the function signature: use a u_int for the
syscall number since this is a more correct type (see the 'code' member
of struct syscall_args), and make the thread pointer the first argument.
The latter is more natural and conventional.

Suggested by:   jrtc27
Reviewed by: jrtc27, markj, jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37200

18 months agolinux: populate sv_syscallnames in each sysentvec
Mitchell Horne [Fri, 28 Oct 2022 21:19:39 +0000 (18:19 -0300)]
linux: populate sv_syscallnames in each sysentvec

This allows the syscallname() function to give a usable result for Linux
ABIs.

Reported by: jrtc27
Reviewed by: jrtc27, markj, jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37199

18 months agoDisable Hyper-V on arm64
Andrew Turner [Fri, 28 Oct 2022 21:15:18 +0000 (22:15 +0100)]
Disable Hyper-V on arm64

It unconditionally calls into the Hyper-V firmware. As most arm64
boards don't have said firmware disable it for now.

18 months agoRemove the hyperv option from std.dev
Andrew Turner [Fri, 28 Oct 2022 21:14:33 +0000 (22:14 +0100)]
Remove the hyperv option from std.dev

It's already in std.hyperv and we don't need to repeat it here.

18 months agorelease: Add support for creating ZFS-based VM images
Mark Johnston [Fri, 28 Oct 2022 20:53:36 +0000 (16:53 -0400)]
release: Add support for creating ZFS-based VM images

The change extends vmimage.subr to handle a new parameter, VMFS, which
should be equal to either "ufs" or "zfs".  When it is set to ZFS, we use
makefs to create a bootable pool populated using the same dataset layout
as bsdinstall and "poudriere image" use.  The pool can be grown using
the growfs rc.d script, just as in UFS images.

This will make it easy to provide VM and cloud images with ZFS as the
root filesystem.  So far I did not do extensive testing of cloud images;
I merely verified that creation of ZFS-based AWS AMIs works and allows
me to create amd64 and arm64 EC2 instances with ZFS as the root
filesystem.

Reviewed by: emaste, gjb
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34426

18 months agomakefs: Fix handling of inherited mountpoints
Mark Johnston [Fri, 28 Oct 2022 20:51:00 +0000 (16:51 -0400)]
makefs: Fix handling of inherited mountpoints

Commit d7eec79b7021 overlooked the fact that
nvlist_find(DATA_TYPE_STRING) does not provide a nul-terminated string.
Fix the leak a different way.

Fixes: d7eec79b7021 ("makefs: Plug a memory leak")

18 months agowg: Trim compat shims for versions older than current stable/13.
John Baldwin [Fri, 28 Oct 2022 20:36:13 +0000 (13:36 -0700)]
wg: Trim compat shims for versions older than current stable/13.

Reviewed by: kevans, markj, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36913

18 months agowg: Retire now unused support.h.
John Baldwin [Fri, 28 Oct 2022 20:36:13 +0000 (13:36 -0700)]
wg: Retire now unused support.h.

Reviewed by: kevans, markj, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36912

18 months agowg: Use zfree.
John Baldwin [Fri, 28 Oct 2022 20:36:13 +0000 (13:36 -0700)]
wg: Use zfree.

Reviewed by: kevans, markj, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36911

18 months agowg: Use atomic(9) instead of concurrency-kit atomics.
John Baldwin [Fri, 28 Oct 2022 20:36:13 +0000 (13:36 -0700)]
wg: Use atomic(9) instead of concurrency-kit atomics.

Kernel sanitizers only support atomic(9) operations.

Reviewed by: kevans, markj, emaste
Reported by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36910

18 months agoImport the WireGuard driver from zx2c4.com.
John Baldwin [Fri, 28 Oct 2022 20:36:12 +0000 (13:36 -0700)]
Import the WireGuard driver from zx2c4.com.

This commit brings back the driver from FreeBSD commit
f187d6dfbf633665ba6740fe22742aec60ce02a2 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

18 months agoSplit netinet shell tests into one per line.
John Baldwin [Fri, 28 Oct 2022 20:36:12 +0000 (13:36 -0700)]
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

18 months agosys/modules: Catchup to armv[45] being removed
Warner Losh [Fri, 28 Oct 2022 19:45:30 +0000 (13:45 -0600)]
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

18 months agosys/modules: Delete now empty if
Warner Losh [Fri, 28 Oct 2022 19:31:38 +0000 (13:31 -0600)]
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: ba9f71ddeca8
Noticed by: jrtc27
Sponsored by: Netflix

18 months agons8250: Fix sense of LSR_TEMT FCR check
Colin Percival [Fri, 28 Oct 2022 04:42:44 +0000 (21:42 -0700)]
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: c4b68e7e53bb "ns8250: Check if flush via FCR succeeded"
Differential Revision: https://reviews.freebsd.org/D37185

18 months agosys/modules: simplify a little by moving syscons to x86 only
Warner Losh [Fri, 28 Oct 2022 17:51:02 +0000 (11:51 -0600)]
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

18 months agosys/modules: tidy up a bit by moving _hyperv to aarch64 section
Warner Losh [Fri, 28 Oct 2022 17:46:48 +0000 (11:46 -0600)]
sys/modules: tidy up a bit by moving _hyperv to aarch64 section

Suggested by: jhb
Sponsored by: Netflix

18 months agoEnable more extres options when FDT is missing
Andrew Turner [Fri, 28 Oct 2022 17:30:55 +0000 (18:30 +0100)]
Enable more extres options when FDT is missing

These now build when FDT is not included in the kernel config.

Sponsored by: Innovate UK

18 months agoOnly include regdev_if.h when it's needed
Andrew Turner [Fri, 28 Oct 2022 17:27:24 +0000 (18:27 +0100)]
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

18 months agoFix the includes in regulator_fixed.c
Andrew Turner [Fri, 28 Oct 2022 17:19:43 +0000 (18:19 +0100)]
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

18 months agoOnly include phydev_if.h when needed
Andrew Turner [Fri, 28 Oct 2022 17:13:38 +0000 (18:13 +0100)]
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

18 months agoInclude sys/systm.h in phy_usb.c for KASSERT
Andrew Turner [Fri, 28 Oct 2022 17:12:31 +0000 (18:12 +0100)]
Include sys/systm.h in phy_usb.c for KASSERT

Rather than depending on header pollution include systm.h directly.

Sponsored by: Innovate UK

18 months agoAllow clk_fixed.c to be built without FDT
Andrew Turner [Fri, 28 Oct 2022 16:45:41 +0000 (17:45 +0100)]
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

18 months agoRemove unneeded headers from clk_link.c
Andrew Turner [Fri, 28 Oct 2022 16:44:33 +0000 (17:44 +0100)]
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

18 months agoriscv: improve parsing of riscv,isa property strings
Mitchell Horne [Fri, 28 Oct 2022 16:28:08 +0000 (13:28 -0300)]
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

18 months agoacpica: Fix the botched merge
Jung-uk Kim [Fri, 28 Oct 2022 02:36:35 +0000 (22:36 -0400)]
acpica: Fix the botched merge

Fixes: 9a4bc5208fad acpica: Import ACPICA 20221020

18 months agoacpica: Merge ACPICA 20221020
Jung-uk Kim [Fri, 28 Oct 2022 02:04:32 +0000 (22:04 -0400)]
acpica: Merge ACPICA 20221020

18 months agoacpica: Import ACPICA 20221020
Jung-uk Kim [Thu, 27 Oct 2022 21:34:40 +0000 (17:34 -0400)]
acpica: Import ACPICA 20221020

(cherry picked from commit a799bdd9d50e84cd6a36e8f1d2ac4301b2a6b374)

18 months agoarm64: Implement cpu_ptrace().
Olivier Houchard [Thu, 27 Oct 2022 21:25:59 +0000 (23:25 +0200)]
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

18 months agoscript: Handle a missing 's' stamp gracefully.
Dag-Erling Smørgrav [Thu, 27 Oct 2022 20:04:48 +0000 (20:04 +0000)]
script: Handle a missing 's' stamp gracefully.

Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37182

18 months agoscript: Further usage string nits.
Dag-Erling Smørgrav [Thu, 27 Oct 2022 15:36:10 +0000 (15:36 +0000)]
script: Further usage string nits.

Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37177

18 months agoscript: Use size_t / ssize_t where needed.
Dag-Erling Smørgrav [Thu, 27 Oct 2022 15:10:30 +0000 (15:10 +0000)]
script: Use size_t / ssize_t where needed.

Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37177

18 months agohyperv: Don't build on 32-bit arm
Warner Losh [Thu, 27 Oct 2022 19:18:52 +0000 (13:18 -0600)]
hyperv: Don't build on 32-bit arm

Sponsored by: Netflix

18 months agoAdd a LINT-ACPI arm64 config
Andrew Turner [Thu, 27 Oct 2022 17:58:21 +0000 (18:58 +0100)]
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

18 months agoStop building FDT-only modules in an ACPI only kernel
Andrew Turner [Thu, 27 Oct 2022 17:01:44 +0000 (17:01 +0000)]
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

18 months agokboot: Add hostfs
Warner Losh [Thu, 27 Oct 2022 17:37:54 +0000 (11:37 -0600)]
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

18 months agostand/kboot: Make FDT fixup per-arch
Warner Losh [Thu, 27 Oct 2022 17:36:51 +0000 (11:36 -0600)]
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

18 months agobhyve: Implement MSR_MISC_FEATURES_ENABLES
Warner Losh [Thu, 27 Oct 2022 17:32:18 +0000 (11:32 -0600)]
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

18 months agosplit: reset errno prior to getline()
Math Ieu [Thu, 27 Oct 2022 17:01:57 +0000 (12:01 -0500)]
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: 5c053aa3c5e90 ("split: switch to getline() [...]")

18 months agoMake sure error is defined in dpaa2
Andrew Turner [Thu, 27 Oct 2022 16:59:48 +0000 (17:59 +0100)]
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

18 months agoIncrease MAX_APIC_ID safeguard to 0x800
Ed Maste [Thu, 20 Oct 2022 13:04:37 +0000 (09:04 -0400)]
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

18 months agoAllow the extres regulator code to build without FDT
Andrew Turner [Thu, 27 Oct 2022 16:28:56 +0000 (17:28 +0100)]
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

18 months agoOnly build if_mvneta.c when FDT is defined
Andrew Turner [Thu, 27 Oct 2022 16:21:02 +0000 (17:21 +0100)]
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

18 months agoFix xdma_if.m in an ACPI only kernel
Andrew Turner [Thu, 27 Oct 2022 16:17:20 +0000 (17:17 +0100)]
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

18 months agoMark FDT only drivers as such
Andrew Turner [Thu, 27 Oct 2022 15:57:23 +0000 (16:57 +0100)]
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

18 months agoRemove an unneeded cpu_dcache_wb_range from arm64
Andrew Turner [Tue, 18 Oct 2022 16:37:43 +0000 (17:37 +0100)]
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

18 months agoarm64: add a std.ec2 config
Kyle Evans [Wed, 28 Sep 2022 20:24:53 +0000 (15:24 -0500)]
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

18 months agonetlink: use (void) for function definitions with no arguments
Ed Maste [Thu, 27 Oct 2022 14:49:51 +0000 (10:49 -0400)]
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

18 months agobhyve: Remove an unused parameter from pci_nvme_append_iov_req()
Mark Johnston [Thu, 27 Oct 2022 14:47:17 +0000 (10:47 -0400)]
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

18 months agobhyve: Fix an apparent pointer arithmetic bug in the xhci emulation
Mark Johnston [Thu, 27 Oct 2022 14:46:53 +0000 (10:46 -0400)]
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

18 months agobhyve: Make sure that the VNC version is initialized
Mark Johnston [Thu, 27 Oct 2022 14:46:36 +0000 (10:46 -0400)]
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

18 months agoscript: Add usage string for playback mode.
Dag-Erling Smørgrav [Wed, 26 Oct 2022 18:12:02 +0000 (18:12 +0000)]
script: Add usage string for playback mode.

Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37138

18 months agoscript: Correct -F in man page and usage string.
Dag-Erling Smørgrav [Wed, 26 Oct 2022 18:08:12 +0000 (18:08 +0000)]
script: Correct -F in man page and usage string.

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

18 months agoarm64: Hyper-V: enablement for ARM64 in Hyper-V (Part 3, final)
Souradeep Chakrabarti [Thu, 27 Oct 2022 13:46:08 +0000 (13:46 +0000)]
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

18 months agostress2: Added a newfs(8) test scenario
Peter Holm [Thu, 27 Oct 2022 07:59:16 +0000 (09:59 +0200)]
stress2: Added a newfs(8) test scenario

18 months agostress2: Added a regression test for a ffs validate_sblock() fix
Peter Holm [Thu, 27 Oct 2022 07:57:57 +0000 (09:57 +0200)]
stress2: Added a regression test for a ffs validate_sblock() fix

18 months agoMFV: Restore the ability to process files from stdin immediately.
Xin LI [Thu, 27 Oct 2022 07:12:53 +0000 (00:12 -0700)]
MFV: Restore the ability to process files from stdin immediately.

PR: bin/267221
MFC after: 3 days

18 months agoUse the -n flag to produce immediate results and kill the short-lived -I.
Christos Zoulas [Wed, 26 Oct 2022 16:56:14 +0000 (16:56 +0000)]
Use the -n flag to produce immediate results and kill the short-lived -I.

(cherry picked from commit 425f9897f0ed791a6c216c24375bd9b3a42330a2)

18 months agoIn immediate mode, print with the current width.
Christos Zoulas [Mon, 24 Oct 2022 20:21:54 +0000 (20:21 +0000)]
In immediate mode, print with the current width.

(cherry picked from commit 7d489233e5f27decdbcfb0e8ecba0b0b5fdc6066)

18 months agoPR/397: dadv: Restore the ability of processing filenames from stdin
Christos Zoulas [Sun, 23 Oct 2022 14:22:53 +0000 (14:22 +0000)]
PR/397: dadv: Restore the ability of processing filenames from stdin
immediately, using the -I flag.

(cherry picked from commit ae5c1ff8df0d6e00cbf5e31875d777edbb88d60a)

18 months agopsci: set psci_present as early as possible
Kyle Evans [Thu, 27 Oct 2022 03:46:45 +0000 (22:46 -0500)]
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: 2218070b2c3c32 ("psci: finish psci_present implementation")
Reported by: karels

18 months agoffs validate_sblock(): avoid 32bit mul overflow
Konstantin Belousov [Mon, 24 Oct 2022 21:34:15 +0000 (00:34 +0300)]
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

18 months agovfs_lookup(): Minor performance optimizations
Jason A. Harmening [Thu, 20 Oct 2022 03:33:19 +0000 (22:33 -0500)]
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

18 months agovfs_busy(): fix wording in comment
Jason A. Harmening [Thu, 20 Oct 2022 03:31:44 +0000 (22:31 -0500)]
vfs_busy(): fix wording in comment

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

18 months agoRemove witness directives from crossmp locking VOPs
Jason A. Harmening [Fri, 5 Aug 2022 05:39:04 +0000 (00:39 -0500)]
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
a2d35545429117e68fbcbc68e14ad55e84265d69.  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

18 months agoAdd VV_CROSSLOCK vnode flag to avoid cross-mount lookup LOR
Jason A. Harmening [Fri, 5 Aug 2022 05:32:49 +0000 (00:32 -0500)]
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

18 months agovmm: Fix AP startup with old userspace binaries.
John Baldwin [Wed, 26 Oct 2022 21:22:56 +0000 (14:22 -0700)]
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 0bda8d3e9f7a 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

18 months agoUPDATING: correct spearate typo
Ed Maste [Wed, 26 Oct 2022 18:25:12 +0000 (14:25 -0400)]
UPDATING: correct spearate typo

Reported by: manu
Fixes: 9c36300582ec ("UPDATING: add an introductory...")

18 months agoUPDATING: add an introductory sentence to 20221026's entry
Ed Maste [Wed, 26 Oct 2022 18:10:46 +0000 (14:10 -0400)]
UPDATING: add an introductory sentence to 20221026's entry

18 months agoUPDATING: Add note for pkgbase users after splitting packages.
Emmanuel Vadot [Wed, 26 Oct 2022 17:48:32 +0000 (19:48 +0200)]
UPDATING: Add note for pkgbase users after splitting packages.

18 months agopkgbase: Put less in FreeBSD-runtime
Emmanuel Vadot [Tue, 16 Aug 2022 19:25:38 +0000 (21:25 +0200)]
pkgbase: Put less in FreeBSD-runtime

Useful to have a pager in it.

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

18 months agopkgbase: Create a FreeBSD-games package
Emmanuel Vadot [Mon, 8 Aug 2022 17:56:50 +0000 (19:56 +0200)]
pkgbase: Create a FreeBSD-games package

And put :
- pom
- caesar
- grdc

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

18 months agopkgbase: Put devmatch in its own package
Emmanuel Vadot [Fri, 22 Jul 2022 20:30:11 +0000 (22:30 +0200)]
pkgbase: Put devmatch in its own package

devmatch is useful on standalone machine but not on jails.
Put devinfo(8) and libdevinfo there too.

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

18 months agopkgbase: Put devd in its own package
Emmanuel Vadot [Fri, 22 Jul 2022 12:46:30 +0000 (14:46 +0200)]
pkgbase: Put devd in its own package

It's not that useful in a jail or in a mdroot.

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

18 months agopkgbase: Put ufs related tools and lib in their own package
Emmanuel Vadot [Fri, 22 Jul 2022 11:22:29 +0000 (13:22 +0200)]
pkgbase: Put ufs related tools and lib in their own package

It's not really useful in a jail or in a mdroot or even if a users
wants to do a full zfs machine.

Reviewed by: mckusick
Differential Revision: https://reviews.freebsd.org/D36227

18 months agopkgbase: Put libwrap in FreeBSD-tcpd package
Emmanuel Vadot [Fri, 22 Jul 2022 09:06:05 +0000 (11:06 +0200)]
pkgbase: Put libwrap in FreeBSD-tcpd package

It belongs there with the tcp wrapper utilities

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

18 months agopkgbase: Put zfs utilities and lib in their own package
Emmanuel Vadot [Fri, 22 Jul 2022 08:43:39 +0000 (10:43 +0200)]
pkgbase: Put zfs utilities and lib in their own package

It is useful to have zfs utilities and lib in a separate package as
it allow users to create image that can support ZFS (i.e. not with
WITHOUT_ZFS in src.conf set) without bloating the default image with
all zfs tools (for example for jails).

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

18 months agopkgbase: Put geom utilities in their own package
Emmanuel Vadot [Fri, 22 Jul 2022 08:19:07 +0000 (10:19 +0200)]
pkgbase: Put geom utilities in their own package

For most users it's not needed to boot and they are also
available in the FreeBSD-rescue package in case an update
break and FreeBSD-geom package isn't updated correctly.

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

18 months agopkgbase: Put resolvconf in its own package
Emmanuel Vadot [Fri, 22 Jul 2022 08:01:59 +0000 (10:01 +0200)]
pkgbase: Put resolvconf in its own package

It doesn't really make sense to have it in runtime and let's not
bloat utilities more.

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

18 months agopkgbase: Put dhclient in its own package
Emmanuel Vadot [Fri, 22 Jul 2022 08:00:03 +0000 (10:00 +0200)]
pkgbase: Put dhclient in its own package

It doesn't really make sense to have it in runtime and let's not
bloat utilities more.

Reviewed by: emaste, imp
Differential Revision: https://reviews.freebsd.org/D36222

18 months agopkgbase: Put nvmecontrol in its own package
Emmanuel Vadot [Fri, 22 Jul 2022 07:58:11 +0000 (09:58 +0200)]
pkgbase: Put nvmecontrol in its own package

It doesn't really make sense to have it in runtime and let's not
bloat utilities more.

Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D36221

18 months agosendmail: fix auth with cyrus-sasl-2.1.28
Ed Maste [Tue, 25 Oct 2022 15:53:07 +0000 (11:53 -0400)]
sendmail: fix auth with cyrus-sasl-2.1.28

Apply patch extracted from sendmail-8-17.1.9 snapshot by dinoex@.

PR: 262935
Reviewed by: gshapiro
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D37119

18 months agow: Fix premature rounding.
Dag-Erling Smørgrav [Mon, 24 Oct 2022 14:02:11 +0000 (14:02 +0000)]
w: Fix premature rounding.

If the system has been up more longer than a minute, we add 30 seconds to
the uptime so that subsequent calculations will round to the nearest minute
rather than truncate.  However, since the introduction of libxo, we output
the raw value after performing the adjustment.  Rewrite so that we output
the raw value first, then perform the adjustment and recalculate before
outputting the humanized value.

While there, reduce stack usage and avoid needless allocations.

Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37128

18 months agovfs: use cache_assert_no_entries instead of open-coding it
Mateusz Guzik [Wed, 26 Oct 2022 15:33:47 +0000 (15:33 +0000)]
vfs: use cache_assert_no_entries instead of open-coding it

18 months agoqlnxe(4): Fix a typo in a source code comment
Gordon Bergling [Wed, 26 Oct 2022 15:27:07 +0000 (17:27 +0200)]
qlnxe(4): Fix a typo in a source code comment

- s/defult/default/

MFC after: 3 days

18 months agonetinet*: add back necessary headers
Gleb Smirnoff [Tue, 25 Oct 2022 21:19:34 +0000 (14:19 -0700)]
netinet*: add back necessary headers

The LINT successful build was provided by the includes that SCTP
pulled in.

Fixes: 92e190f11fe872f7b1f1a1a22c1f10edeb3b7f8d

18 months agoHyper-V: Code refactor to avoid redundancy of MSR values on x86 and arm64
Souradeep Chakrabarti [Wed, 26 Oct 2022 03:29:01 +0000 (03:29 +0000)]
Hyper-V: Code refactor to avoid redundancy of MSR values on x86 and arm64

Refactor the code to put split the MSR values for x86 and arm64
Hyper-V. Code not yet built. This is one of several patches for
the arm64 Hyper-V enablement.

Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D37103

18 months agosplit: add word order fix
Kyle Evans [Tue, 25 Oct 2022 21:51:21 +0000 (16:51 -0500)]
split: add word order fix

This was meant to note that both pattern and line matching were
previously restricted, but words are difficult.  +line and rearrange.

Sponsored by: Klara, Inc.

18 months agostrfmon(3): Fix # explanation
Jose Luis Duran [Thu, 13 Oct 2022 16:11:31 +0000 (13:11 -0300)]
strfmon(3): Fix # explanation

There's only one value that specifies the number of digits after the
decimal point (oh, sorry, the "radix character") the other specifies the
number before...

While here, add a little more info on the effects of using the #n value.

Obtained from: https://github.com/NetBSD/src/commit/d1dd1a086400ae719bde1f2c45938d9bc1d29e8b
Reviewed by: kib
PR: 267282
Github PR: #619
MFC after: 1 week

18 months agostrfmon(3): Remove repeated words
Jose Luis Duran [Thu, 13 Oct 2022 16:22:54 +0000 (13:22 -0300)]
strfmon(3): Remove repeated words

Reviewed by: kib
PR: 267282
Github PR: #619
MFC after: 1 week

18 months agostrfmon: Fix formatting of a second fixed-width value
Jose Luis Duran [Fri, 21 Oct 2022 19:34:09 +0000 (16:34 -0300)]
strfmon: Fix formatting of a second fixed-width value

There is a bug when formatting two consecutive values using fixed-widths
and the values need padding.  This was because the value of pad_size
was zeroed only every other time.

Format           Before                         After
[%8n] [%8n]      [ $123.45] [       $123.45]    [ $123.45] [ $123.45]

Reviewed by: kib
PR: 267282
Github PR: #619
MFC after: 1 week

18 months agostrfmon: Fix an edge case when sep_by_space is 2
Jose Luis Duran [Tue, 18 Oct 2022 02:24:03 +0000 (23:24 -0300)]
strfmon: Fix an edge case when sep_by_space is 2

Fix an edge case by printing the required space when, the currency
symbol succeeds the value, a space separates the sign from the value and
the sign position precedes the quantity and the currency symbol.

In other words:

    n_cs_precedes = 0
    n_sep_by_space = 2
    n_sign_posn = 1

From The Open Group's localeconv[1]:

> When {p,n,int_p,int_n}_sep_by_space is 2:
> If the currency symbol and sign string are adjacent, a space separates
> them; otherwise, a space separates the sign string from the value.

    Format    Before        After
    [%n]      [-123.45¤]    [- 123.45¤]

[1]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/localeconv.html

Obtained from: Darwin
Reviewed by: kib
PR: 267282
Github PR: #619
MFC after: 1 week

18 months agostrfmon: Fix alignment when enclosed by parentheses
Jose Luis Duran [Fri, 14 Oct 2022 23:26:32 +0000 (20:26 -0300)]
strfmon: Fix alignment when enclosed by parentheses

Take into consideration the possibility of quantities enclosed by
parentheses when aligning.

Matches the examples from The Open Group's:

Format  Before          After
%(#5n   [$   123.45]    [ $   123.45 ]  Use an alternative pos/neg style
        [($   123.45)]  [($   123.45)]
        [$ 3,456.78]    [ $ 3,456.78 ]

%!(#5n  [   123.45]     [    123.45 ]   Disable the currency symbol
        [(   123.45)]   [(   123.45)]
        [ 3,456.78]     [  3,456.78 ]

https://pubs.opengroup.org/onlinepubs/9699919799/functions/strfmon.html

SD5-XSH-ERN-29 is applied, updating the examples for %(#5n and %!(#5n.

Obtained from: Darwin
Reviewed by: kib
PR: 267282
Github PR: #619
MFC after: 1 week

18 months agostrfmon: Trim the SPACE from international currency symbol
Jose Luis Duran [Fri, 21 Oct 2022 16:13:27 +0000 (13:13 -0300)]
strfmon: Trim the SPACE from international currency symbol

The international currency symbol (int_curr_symbol) has a mandatory
SPACE character as the last character.

Trim this space after reading it, otherwise this extra space will always
be printed when displaying the int_curr_symbol.

Fixes the output when the international currency format is selected
(%i).

    Locale         Format    Before           After
    en_US.UTF-8    [%i]      [USD 123.45]     [USD123.45]
    fr_FR.UTF-8    [%i]      [123,45 EUR ]    [123,45 EUR]

Note that the en_US.UTF-8 locale states that no space should be printed
between the currency symbol and the value (sep_by_space = 0).

Reviewed by: kib
PR: 267282
Github PR: #619
MFC after: 1 week

18 months agostrfmon: Avoid an out-of-bounds access
Jose Luis Duran [Thu, 13 Oct 2022 15:51:27 +0000 (12:51 -0300)]
strfmon: Avoid an out-of-bounds access

Avoid an out-of-bounds access when trying to set the space_char using an
international currency format (%i) and the C/POSIX locale.

The current code tries to read the SPACE from int_curr_symbol[3]:

    currency_symbol = strdup(lc->int_curr_symbol);
    space_char = *(currency_symbol+3);

But on C/POSIX locales, int_curr_symbol is empty.

Three implementations have been examined: NetBSD[1], Darwin[2], and
Illumos[3].  Only NetBSD has fixed it[4].

Darwin and NetBSD also trim the mandatory final SPACE character after
reading it.

    Locale         Format    Darwin/NetBSD    FreeBSD/Illumos
    en_US.UTF-8    [%i]      [USD123.45]      [USD 123.45]
    fr_FR.UTF-8    [%i]      [123,45 EUR]     [123,45 EUR ]

This commit only fixes the out-of-bounds access.

[1]: https://github.com/NetBSD/src/blob/trunk/lib/libc/stdlib/strfmon.c
[2]: https://opensource.apple.com/source/Libc/Libc-1439.141.1/stdlib/NetBSD/strfmon.c.auto.html
[3]: https://github.com/illumos/illumos-gate/blob/master/usr/src/lib/libc/port/locale/strfmon.c
[4]: https://github.com/NetBSD/src/commit/3d7b5d498aa9609f2bc9ece9c734c5f493a8e239

Reviewed by: kib
PR: 267282
Github PR: #619
MFC after: 1 week

18 months agostrfmon: Fix typos in source code comments
Jose Luis Duran [Thu, 13 Oct 2022 14:49:21 +0000 (11:49 -0300)]
strfmon: Fix typos in source code comments

s/defult/default
s/internaltion/international

Reviewed by: kib
PR: 267282
Github PR: #619
MFC after: 1 week

18 months agostrfmon: Fix typo in constant
Jose Luis Duran [Thu, 13 Oct 2022 14:36:46 +0000 (11:36 -0300)]
strfmon: Fix typo in constant

s/SUPRESS_CURR_SYMBOL/SUPPRESS_CURR_SYMBOL

Reviewed by: kib
PR: 267282
Github PR: #619
MFC after: 1 week

18 months agostrfmon: Code cleanup
Jose Luis Duran [Fri, 14 Oct 2022 17:05:22 +0000 (14:05 -0300)]
strfmon: Code cleanup

No functional change intended.
Not claiming full style(9) compliance.

Reviewed by: kib
PR: 267282
Github PR: #619
MFC after: 1 week