vmm: Add an include to vmm_ktr.h for vm_name()
Required when KTR is configured.
Remove the pcpu.h include while here, as it seems to be unneeded.
Reported by: Jenkins
Fixes: 5f13d6b60740 ("vmm: Move common accessors and vm_eventinfo into sys/dev/vmm")
vmm: Move common accessors and vm_eventinfo into sys/dev/vmm
Now that struct vm and struct vcpu are defined in headers, provide
inline accessors. We could just remove the accessors outright, but they
don't hurt and it would result in unneeded churn.
As a part of this, consolidate definitions related to struct
vm_eventinfo as well. I'm not sure if struct vm_eventinfo is really
needed anymore, now that vmmops_run implementations can directly access
vm and vcpu fields, but this can be resolved later.
No functional change intended.
MFC after: 2 months
Sponsored by: The FreeBSD Foundation
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D53586
vmm: Deduplicate VM and vCPU state management code
Now that the machine-independent fields of struct vm and struct vcpu are
available in a header, we can move lots of duplicated code into
sys/dev/vmm/vmm_vm.c. This change does exactly that.
No functional change intended.
MFC after: 2 months
Sponsored by: The FreeBSD Foundation
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D53585
vmm: Consolidate vm and vcpu definitions
There is quite a lot of duplication of code between amd64, arm64 and
riscv with respect to VM and vCPU state management. This is a bit
tricky to resolve since struct vm and struct vcpu are private to vmm.c
and both structures contain a mix of machine-dependent and
machine-independent fields.
To allow deduplication without also introducing a lot of churn, follow
the approach of struct pcpu and 1) lift the definitions of those
structures into a new header, sys/dev/vmm/vmm_vm.h, and 2) define
machine-dependent macros, VMM_VM_MD_FIELDS and VMM_VCPU_MD_FIELDS which
lay out the machine-dependent fields.
One disadvantage of this approach is that the two structures are no
longer private to vmm.c, but I think this is acceptable.
No functional change intended. A follow-up change will move a good deal
of machine/vmm/vmm.c into sys/dev/vmm/vmm_vm.c.
[5 lines not shown]
libc++: silence -Wnontrivial-memaccess warning with newer clang
Apply part of LLVM commit 71315698c91d0cda054b903da0594ca6f072c350 to
silence the -Wnontrivial-memaccess warning that is triggered any time
this function is instantiated by user code. This fixes another
buildworld failure with Clang HEAD.
Original commit message:
[clang] Warn about memset/memcpy to NonTriviallyCopyable types (#111434)
This implements a warning that's similar to what GCC does in that
context: both memcpy and memset require their first and second operand
to be trivially copyable, let's warn if that's not the case.
Reviewed by: emaste, dim
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D52534
(cherry picked from commit 34a006eaa39ceb6b0a96fa386c9b9b8a44681979)
(cherry picked from commit ca149d75e9bd6455abc3c74e7db160464cfabbdb)
libc++: avoid use of deprecated builtin
This pulls in LLVM commit accfbd4cb327411ad66c0109ba1841482b871967 to
avoid the use of __libcpp_is_trivially_relocatable.
This fixes building FreeBSD libc++ with clang HEAD as of today.
Original commit message:
[libc++] Replace __is_trivially_relocatable by is_trivially_copyable (#124970)
The __is_trivially_relocatable builtin has semantics that do not
correspond to any current or future notion of trivial relocation.
Furthermore, it currently leads to incorrect optimizations for some
types on supported compilers:
- Clang on Windows where types with non-trivial destructors get
incorrectly optimized
- AppleClang where types with non-trivial move constructors get
incorrectly optimized
Until there is an agreed upon and bugfree implementation of what it
[10 lines not shown]
bhyve: support MTU configuration for SLIRP net backend
Support configuring MTU for the SLIRP net backend, for example:
-s 1:0,virtio-net,slirp,mtu=2048,open
Update the manual page accordingly. While here, also document
MAC address configuration.
Reviewed by: markj
Approved by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D54133
nfsd: Fix handling of hidden/system during Open/Create
When an NFSv4.n client specifies settings for the archive,
hidden and/or system attributes during a Open/Create, the
Open/Create fails for ZFS. This is caused by ZFS doing
a secpolicy_xvattr() call, which fails for non-root.
If this check is bypassed, ZFS panics.
This patch resolves the problem by disabling va_flags
for the VOP_CREATE() call in the NFSv4.n server and
then setting the flags with a subsequent VOP_SETATTR().
This problem only affects FreeBSD-15 and main, since the
archive, system and hidden attributes are not enabled
for FreeBSD-14.
I think a similar problem exists for the NFSv4.n
Open/Create/Exclusive_41, but that will be resolved
in a future commit.
[9 lines not shown]
sesutil: Remove width modifier on encoded "Desc" field
Remove the width modifier to remove white space padding
added to "description" field when running
`sesutil --libxo:JP show`.
Reviewed by: asomers
Approved by: asomers (mentor)
MFC after: 1w
Sponsored by: ConnectWise
Differential Revision: https://reviews.freebsd.org/D54536
bhyve: add UNIX domain socket support to rfb
This commit adds support for a UNIX domain socket to bhyve's remote
framebuffer. It enables the use of the graphical console when the bhyve instance
is running in a jail with no networking, for instance. A VNC client running on
the host can then connect to the UNIX domain socket through the filesystem.
Signed-off-by: Quentin Thébault <quentin.thebault at defenso.fr>
Sponsored by: Defenso
Reviewed by: kevans, markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D53814
amd64: Remove tpm(4) from GENERIC for now
It breaks suspend/resume and no one has had time to investigate and fix
it.
PR: 291067
Reviewed by: emaste
Fixes: 3deb21f1afd5 ("random: TPM_HARVEST should have been named RANDOM_ENABLE_TPM")
Differential Revision: https://reviews.freebsd.org/D54587
bnxt: fix i2c read to allow access to different addresses
Allow reading of i2c addresses other than A0. A0 does provide most
information, but doesn't provide things like module temps, and optical
signal levels.
Sponsored by: Netflix
Reviewed by: sumit.saxena_broadcom.com
Differential Revision: https://reviews.freebsd.org/D54590
MFC after: 3 days
pf: remove redundant zeroing
nlmsg_reserve_object() already zeroes the header before it gives it to
us, so there's no need to explicitly zero these fields again.
Sponsored by: Rubicon Communications, LLC ("Netgate")
acpi: Make taskqueue only run on BSP
This is needed because when we add the suspend-to-idle loop, we only
want to break the BSP out of idle to process the taskqueue while keeping
all the others idled.
Currently assuming BSP to be CPU0, which may not always be the case on
non-x86.
Reviewed by: kib
Approved by: kib
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D54406
nuageinit: set the hostname when user-data is missing
This address the situation reported here
https://github.com/freebsd/freebsd-src/pull/1952#issuecomment-3720210259
The user-data file was missing and the `sethostname` function is never
called. This commit adjusts slightly the logic to avoid the `exit()` call
when the `user-data` file is missing.
MFC After: 1 week
Signed-off-by: Gonéri Le Bouder <goneri at lebouder.net>
Differential Revision: https://github.com/freebsd/freebsd-src/pull/1953
nuageinit: fix test after recent behaviour change
with recent change nuageinit always create a "freebsd" user, if no
users are specified, which means we do need to get the rootdir in the
testsuite containing a group file otherwise pw complains and the tests
fails.
GCE: ARM64 Support: Add hw.pci.honor_msi_blacklist=0.
This is required for MSI support on GCE ARM64 instances which is
prerequisite to gve(4) not panicking at boot, and nvme(4) also has
a real sad time without interrupts. Tested on a variety of c4a VMs.
This is meant to be a temporary hack; long term fix would be to
check for the hypervisor and quirk gve(4) device with
PCI_QUIRK_ENABLE_MSI_VM.
PR: kern/292081
MFC after: 1 week
GCE: Fix growfs path
The sed command was missing the ${DESTDIR} prefix, meaning it was
attempting to modify the build host's /etc/rc.d/growfs instead of
the target image's script. Tested in an arm64 builder that builds
as non-root.
PR: kern/292081
MFC after: 1 day
GCE: Enable vtnet(4) Multiqueue.
Removes hw.vtnet.mq_disable=1.
This workaround was originally introduced nearly a decade ago to
address stability issues on KVM that have long since been resolved
in both the FreeBSD driver and the GCE hypervisor. Removing this
allows network interrupts to scale across multiple vCPUs.
Tested on n2-highcpu-16 VM with 15.0-RELEASE and confirmed multiple
queue pairs active and interrupts handling across cores.
PR: kern/292081
MFC after: 1 day
zfs: emit .note.GNU-stack section for all ELF targets
On FreeBSD, linking the zfs kernel module with binutils ld 2.44 shows
the following warning:
ld: warning: aesni-gcm-avx2-vaes.o: missing .note.GNU-stack section implies executable stack
ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
Some of the `.S` files under `module/icp/asm-x86_64/modes` check whether
to emit the `.note.GNU-stack` section using:
#if defined(__linux__) && defined(__ELF__)
We could add `&& defined(__FreeBSD__)` to the test, but since all other
`.S` files in the OpenZFS tree use:
#ifdef __ELF__
it would seem more logical to use that instead. Any recent ELF platform
[5 lines not shown]
tools/cam: Start to add the testing tools for CAM
Create a directory for testing tools arond CAM. These are snippets of
what will eventually be camio. At the moment, it was written using fbt
traces. This is OK, but fragile, so they need to be re-written with the
cam provider. cam_all_but_scsi.d is the first step. It shows how to do
this with the new cam dtrace provider.
Sponsored by: Netflix
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D54472
cam: When inq data isn't valid, pass NULL
When the device isn't there, we don't have valid inq data. Pass NULL in
this case. All the routines that receive this test against NULL already.
Sponsored by: Netflix
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D54470
cam: Start adding dtrace provider 'cam'
Start to provide robust tracing in cam now that clang has broken my
fbt-based dtrace scripts a couple of times.
Sponsored by: Netflix
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D54468