FreeBSD/src 7446569sys/conf files.arm64

conf: Mark vchiq as depending on fdt

Fix an ACPI only kernel by only building the vchiq files when FDT is
enabled.

Fixes:  745c4aa5e8f0 ("Make BRCM2837 port conform FreeBSD/ARM64 guidelines")
Sponsored by:   Arm Ltd
DeltaFile
+9-9sys/conf/files.arm64
+9-91 files

FreeBSD/src 2188e77sys/arm64/arm64 gic_v3_var.h gic_v3.c

arm64: Remove gicv3_get_support_lpis

It's no longer used after moving to gic_get_support_lpis.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D53665
DeltaFile
+0-2sys/arm64/arm64/gic_v3_var.h
+0-1sys/arm64/arm64/gic_v3.c
+0-32 files

FreeBSD/src 3ef673esys/arm64/arm64 gicv3_its.c

arm64: Switch to gic_get_support_lpis in gicv3_its

The old gicv3_get_support_lpis will be removed.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D53664
DeltaFile
+2-2sys/arm64/arm64/gicv3_its.c
+2-21 files

FreeBSD/src a695ac2sys/arm64/arm64 mp_machdep.c

arm64: Move intr_pic_init_secondary earlier

This may have been called after intr_irq_shuffle. For most interrupt
controllers this appears to be safe, however for the GICv5 we need to
read a per-CPU ID register before we can assign interrupts to a given
CPU.

Fix the race by moving intr_pic_init_secondary earlier in the boot,
after devices have been enumerated and before the interrupts are moved
to their assigned CPUs.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D53685
DeltaFile
+2-2sys/arm64/arm64/mp_machdep.c
+2-21 files

FreeBSD/src 8178a4esys/arm/arm gic.c gic_common.h, sys/arm64/arm64 gic_v3.c

arm/gic: Make GICV3_IVAR_SUPPORT_LPIS generic

GICv5 will need this too, so move to the GIC_IVAR namespace.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D53663
DeltaFile
+3-0sys/arm/arm/gic.c
+2-0sys/arm/arm/gic_common.h
+1-0sys/arm64/arm64/gic_v3.c
+6-03 files

FreeBSD/src 262faddsys/arm/arm gic.c

arm: Handle GIC_IVAR_VGIC in the gic driver

We don't have a GICv2 vgic so can just return 0.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D53662
DeltaFile
+3-0sys/arm/arm/gic.c
+3-01 files

FreeBSD/src 4713f54sys/arm64/arm64 nexus.c

arm64: Add non-PCI MSI support

Add the arm64 parts to support for non-PCI MSI and MSI-X interrupts.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D53331
DeltaFile
+85-0sys/arm64/arm64/nexus.c
+85-01 files

FreeBSD/src 68e6422sys/dev/fdt simplebus.c

dev/fdt: Add support for non-PCI MSI interrupts

Some non-PCI devices can send interrupts, e.g. the Arm SMMU or GICv5
Interrupt Wire Bridge. Add support for these by implementing pci_get_id
and pci_alloc_msi and the MSI/MSI-X parts of the PCIB interface.

Only the MSI parts of the PCI interface are added as that is all I am
able to test.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D53330
DeltaFile
+134-0sys/dev/fdt/simplebus.c
+134-01 files

FreeBSD/src 6b12b94sys/dev/ofw ofw_cpu.c

dev/ofw: Teach ofw_cpu to find the pcpu on arm64

Use the midr value to ensure we find the correct PCPU pointer on arm64.

Sponsored by:   Arm Ltd
Differential Revision:  https://reviews.freebsd.org/D53327
DeltaFile
+26-2sys/dev/ofw/ofw_cpu.c
+26-21 files

FreeBSD/src 39ee241libexec/rc rc.subr, share/man/man5 rc.conf.5

rc.subr: Support setting the audit user when starting services

When an unprivileged user restarts a service using, e.g., sudo, the
service runs with the audit user ID set to that of the unprivileged
user.  This can have surprising effects: for instance, a user that
restarts a jail that is running sshd will end up with their UID attached
to all audit logs associated with users who log in via that sshd
instance.  (sshd will set the audit user, but this is disallowed in
jails by default.)

Add support for rc.conf directives which cause rc to override the audit
user.  Specifically, make <name>_audit_user=foo cause the audit user to
be set to "foo" for service <name>.  A plain audit_user=foo directive
causes all services to be started as foo.

Note, like other similar rc features, this feature is limited to rc
services which are run by executing a command.  Shell functions can't be
wrapped this way.


    [5 lines not shown]
DeltaFile
+17-1libexec/rc/rc.subr
+12-2share/man/man5/rc.conf.5
+29-32 files

FreeBSD/src 71f6592libexec/rc rc.subr

rc.subr: Remove misguided cpuset usage

When running an rc command, if the target rc script defines
<command>_cmd, e.g., start_cmd=..., then the run_rc_command() executes
that instead of $command.  In general it's a shell function, and
"cpuset -l <n> <shell function>" doesn't work.

Moreover, it doesn't really make sense to run cpuset for anything other
than start_cmd.

Other optional isolation mechanisms (e.g., <name>_fib,
<name>_chroot) are only used when invoking $command directly as part of
the "start" command.  Make <name>_cpuset consistent with everything else
by removing these extraneous cpuset invocations.

Reviewed by:    0mp
MFC after:      2 weeks
Sponsored by:   Modirum MDPay
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D53746
DeltaFile
+4-4libexec/rc/rc.subr
+4-41 files

FreeBSD/src d795c75sys/kern kern_event.c

kevent: Hold the knlist mutex when invoking f_event(NOTE_FORK)

In general f_event is supposed to be called with the knlist mutex held,
so lock it earlier to follow this protocol.  Also make sure that the
update to kn_fflags is synchronized.

Lock the kqueue itself earlier in the case where the knote is activated,
to avoid locking and unlocking the kqueue twice.

PR:             291005
Reported by:    Qiu-ji Chen <chenqiuji666 at gmail.com>
Reviewed by:    kib
MFC after:      1 week
Differential Revision:  https://reviews.freebsd.org/D53762
DeltaFile
+12-4sys/kern/kern_event.c
+12-41 files

FreeBSD/src 7861d05libexec/rc rc.subr

rc.subr: Try to make svjc option handling a bit easier to read

Specifically, make this code fit in fewer columns:
- deindent cases to conform to the usual style,
- use a local variable to minimize duplication in each case.

No functional change intended.

Reviewed by:    0mp, netchild
MFC after:      2 weeks
Sponsored by:   Klara, Inc.
Sponsored by:   Modirum MDPay
Differential Revision:  https://reviews.freebsd.org/D53754
DeltaFile
+47-41libexec/rc/rc.subr
+47-411 files

FreeBSD/src a9be8f9usr.sbin/setaudit setaudit.c Makefile

setaudit: Bump WARNS and fix some style bugs

- Cast sockaddrs through void to silence warnings about expected
  alignment.
- Fix cast style.
- Sort includes.
- Make some global variables local.
- Sort options.

No functional change intended.

Reviewed by:    csjp
MFC after:      2 weeks
Sponsored by:   Modirum MDPay
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D53670
DeltaFile
+16-18usr.sbin/setaudit/setaudit.c
+0-2usr.sbin/setaudit/Makefile
+16-202 files

FreeBSD/src dcb0790usr.sbin Makefile, usr.sbin/setaudit setaudit.c setaudit.8

setaudit: Initial import

Unmodified sources from https://github.com/csjayp/setaudit at commit
aa4dd9dfa40b6437030d718834236f4eaeb18ccb.

Some follow-up changes will fix a few issues and make it easier to use
this utility in the rc framework.

Reviewed by:    csjp
MFC after:      2 weeks
Sponsored by:   Modirum MDPay
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D53669
DeltaFile
+140-0usr.sbin/setaudit/setaudit.c
+78-0usr.sbin/setaudit/setaudit.8
+8-0usr.sbin/setaudit/Makefile
+2-0usr.sbin/setaudit/.gitignore
+1-0usr.sbin/Makefile
+229-05 files

FreeBSD/src 1238610usr.sbin/setaudit setaudit.c setaudit.8

setaudit: Add an update mode

By default, setaudit(8) overwrites the whole audit session state.  For
the purpose of overwriting only a single field, e.g., the audit user,
this is inconvenient.  Add -U to accomodate this case: when specified,
setaudit(8) will first fetch the current session state block and then
will only overwrite those fields specified on the command line.

Reviewed by:    csjp
MFC after:      2 weeks
Sponsored by:   Modirum MDPay
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D53672
DeltaFile
+28-10usr.sbin/setaudit/setaudit.c
+11-1usr.sbin/setaudit/setaudit.8
+39-112 files

FreeBSD/src 551191eusr.sbin/setaudit setaudit.c setaudit.8

setaudit: Fix handling of numeric UIDs

The usage of strtoul() was incorrect.

Reviewed by:    csjp
MFC after:      2 weeks
Sponsored by:   Modirum MDPay
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D53671
DeltaFile
+4-2usr.sbin/setaudit/setaudit.c
+1-1usr.sbin/setaudit/setaudit.8
+5-32 files

FreeBSD/src 8f2f66bsys/netinet tcp_hpts.h

TCP Pacing system (HPTS) is missing an API

Recent changes to HPTS have broken an API that was somehow removed (used by user space programs for
time calculations). This commit will add back the inline function that was removed.

Differential Revision:<https://reviews.freebsd.org/D53225>
DeltaFile
+11-0sys/netinet/tcp_hpts.h
+11-01 files

FreeBSD/src 6e8e1desys/amd64/include vmm.h, sys/amd64/vmm vmm.c

vmm: Move vm_maxcpu handling into MI code

No functional change intended.

Reviewed by:    corvink
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D53477

(cherry picked from commit c46e5dc65ba5c9666bb4452878e332dc49730843)
DeltaFile
+0-22sys/riscv/vmm/vmm.c
+0-22sys/amd64/vmm/vmm.c
+0-20sys/arm64/vmm/vmm.c
+15-0sys/dev/vmm/vmm_dev.c
+11-0sys/dev/vmm/vmm_dev.h
+0-2sys/amd64/include/vmm.h
+26-661 files not shown
+27-677 files

FreeBSD/src 55096ebsys/arm64/vmm vmm.c

arm64/vmm: Move the vgic_max_cpu_count() check

vm_alloc_vcpu() is called quite frequently, and we don't need to apply
the vgic limit unless we're actually allocating a vcpu structure for the
first time.

No functional change intended.

Reviewed by:    andrew
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D53580

(cherry picked from commit f3a7ed2047dffaebbfbb3920e993e9df424be728)
DeltaFile
+6-4sys/arm64/vmm/vmm.c
+6-41 files

FreeBSD/src 10b2ebbsys/amd64/vmm/io ppt.c ppt.h

amd64/vmm: Remove an unused function

Reviewed by:    corvink, emaste
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D53423

(cherry picked from commit 7214e0469234d90edd6deda4b181cd4862a9ace0)
DeltaFile
+0-7sys/amd64/vmm/io/ppt.c
+0-6sys/amd64/vmm/io/ppt.h
+0-132 files

FreeBSD/src 272c8c2sys/amd64/include vmm.h, sys/amd64/vmm vmm.c

vmm: Consolidate VM name length checking

vm_create() is only called from one place.  Rather than having similar
checks everywhere, move them to vmmdev_create().

We can safely assume that the name is nul-terminated, the vmmctl ioctl
handler and the legacy sysctl handler ensure this.  So, don't bother
with strnlen().

Finally, make sure that the name buffers are the same size on all
platforms.  VM_MAX_NAMELEN is supposed to be the maximum, not including
the nul terminator.

Reviewed by:    corvink
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D53422

(cherry picked from commit 7377c87e467343e71b3e803708b98e04ea8e84bd)
DeltaFile
+33-0sys/dev/vmm/vmm_param.h
+0-26sys/amd64/include/vmm.h
+0-21sys/arm64/include/vmm.h
+1-4sys/riscv/vmm/vmm.c
+1-4sys/arm64/vmm/vmm.c
+0-4sys/amd64/vmm/vmm.c
+35-596 files not shown
+47-6212 files

FreeBSD/src 16fe30dsys/amd64/vmm vmm.c, sys/arm64/vmm vmm.c

vmm: Move the module load handler to vmm_dev.c

Move the vmm_initialized check out of vm_create() and into the legacy
sysctl handler.  If vmm_initialized is false, /dev/vmmctl will not be
available and so cannot be used to create VMs.

Introduce new MD vmm_modinit() and vmm_modcleanup() routines which
handle MD (de)initialization.

No functional change intended.

Reviewed by:    corvink
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D53421

(cherry picked from commit e758074458df3b61773b7678ff47c4a835365d21)
DeltaFile
+10-73sys/amd64/vmm/vmm.c
+9-64sys/arm64/vmm/vmm.c
+63-2sys/dev/vmm/vmm_dev.c
+5-60sys/riscv/vmm/vmm.c
+3-2sys/dev/vmm/vmm_dev.h
+90-2015 files

FreeBSD/src af1dd9csys/amd64/vmm vmm.c

amd64/vmm: Remove useless global variables

No functional change intended.

Reviewed by:    corvink, jhb, emaste
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D53420

(cherry picked from commit 3faad9e26018dfc0ab6da21a53c0310656187d7b)
DeltaFile
+2-8sys/amd64/vmm/vmm.c
+2-81 files

FreeBSD/src 869faf4sys/amd64/include vmm.h, sys/amd64/vmm vmm.c vmm_lapic.c

amd64/vmm: Factor vcpu_notify_event() into two functions

vcpu_notify_event() previously took a boolean parameter which determines
whether the implementation should try to use a posted interrupt.  On
arm64 and riscv, the implementation of vcpu_notify_event() is otherwise
identical to that of amd64.

With the aim of deduplicating vcpu state management code, introduce a
separate amd64-only function which tries to use posted interrupts.  This
requires some duplication with vcpu_notify_event_locked(), but only a
little bit.

Then, fix up callers.  No functional change intended.

Reviewed by:    corvink, jhb
MFC after:      2 weeks
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
Differential Revision:  https://reviews.freebsd.org/D53419

    [2 lines not shown]
DeltaFile
+24-18sys/amd64/vmm/vmm.c
+2-1sys/amd64/include/vmm.h
+1-1sys/amd64/vmm/io/vlapic.c
+1-1sys/amd64/vmm/vmm_lapic.c
+28-214 files

FreeBSD/src 557047esys/dev/vmm vmm_dev.c

vmm: Simplify the VM_ALLOC_MEMSEG ioctl a bit

We can free the mask earlier, simplifying some error paths.  No
functional change intended.

Reviewed by:    corvink, jhb, emaste
Sponsored by:   The FreeBSD Foundation
Sponsored by:   Klara, Inc.
MFC after:      2 weeks
Differential Revision:  https://reviews.freebsd.org/D53418

(cherry picked from commit c3f41c02c9a5bf45504af59c351f0ae336719753)
DeltaFile
+2-6sys/dev/vmm/vmm_dev.c
+2-61 files

FreeBSD/src 187e4b4tests/sys/netinet Makefile

multicast tests: Run in VNET jails

The tests themselves create identically named jails, resulting in
spurious failures when the tests are run in parallel.

MFC after:      1 week

(cherry picked from commit b3b279b801d571919c8bbd5de4325d8819ffd59a)
DeltaFile
+2-0tests/sys/netinet/Makefile
+2-01 files

FreeBSD/src 484fa40sys/modules/zfs Makefile

zfs: fix aarch64 build after zfs-2.4.0-rc4

(cherry picked from commit fb709935d64d5fd4ad21cf8c69faf580760999e4)
DeltaFile
+0-2sys/modules/zfs/Makefile
+0-21 files

FreeBSD/src 3882959contrib/diff/lib getopt.h

diff3: Remove bespoke getopt.h

diff3's getopt.h included a function declaration without a prototype,
which produces a compiler warning.  Just remove the bespoke getopt.h
and use the system header.

Reported by:    Mark Millard
Reviewed by:    fuz
Sponsored by:   The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D53802
DeltaFile
+0-176contrib/diff/lib/getopt.h
+0-1761 files

FreeBSD/src 6ec3d44share/man/man4 geom_zero.4 zero.4

geom_zero.4: Document

PR:     250593
Reviewed by:    bcr, ziaee
Thanks to:      imp, markj
MFC after:      1 week
Fixes:  3843eba85d98 Add unmapped BIO support to GEOM ZERO
Fixes:  24e1fdcd1a69 Allow to specify the byte which will be used for filling read buffer
Fixes:  565bc101112c Add a very simple and small GEOM class - ZERO

(cherry picked from commit 39acb7fd86eda721df402c2f1368b78cede161c3)
DeltaFile
+174-0share/man/man4/geom_zero.4
+2-1share/man/man4/zero.4
+2-0share/man/man4/Makefile
+178-13 files