]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
17 months agovmm: Remove support for vm_rendezvous with a cpuid of -1.
John Baldwin [Fri, 18 Nov 2022 18:03:23 +0000 (10:03 -0800)]
vmm: Remove support for vm_rendezvous with a cpuid of -1.

This is not currently used.

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D37164

(cherry picked from commit 949f0f47a4e774fea7222923440851c612a3f6fa)

17 months agovmm: Remove vcpuid from I/O port handlers.
John Baldwin [Fri, 18 Nov 2022 18:03:14 +0000 (10:03 -0800)]
vmm: Remove vcpuid from I/O port handlers.

No I/O ports are vCPU-specific (unlike memory which does have
vCPU-specific ranges such as the local APIC).

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D37163

(cherry picked from commit 9388bc1e3a58ac17c06e690fb9f46c9f36098f2d)

17 months agovmm: Restore the correct vm_inject_*() prototypes
Mark Johnston [Fri, 18 Nov 2022 19:11:21 +0000 (14:11 -0500)]
vmm: Restore the correct vm_inject_*() prototypes

Fixes: 80cb5d845b8f ("vmm: Pass vcpu instead of vm and vcpuid...")
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D37443

(cherry picked from commit ca6b48f08034114edf1fa19cdc088021af2eddf3)

17 months agovmm: Pass vcpu instead of vm and vcpuid to APIs used from CPU backends.
John Baldwin [Fri, 18 Nov 2022 18:03:05 +0000 (10:03 -0800)]
vmm: Pass vcpu instead of vm and vcpuid to APIs used from CPU backends.

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D37162

(cherry picked from commit 80cb5d845b8f4b7dc25b5dc7f4a9a653b98b0cc6)

17 months agovmm: Use struct vcpu in the instruction emulation code.
John Baldwin [Fri, 18 Nov 2022 18:02:09 +0000 (10:02 -0800)]
vmm: Use struct vcpu in the instruction emulation code.

This passes struct vcpu down in place of struct vm and and integer
vcpu index through the in-kernel instruction emulation code.  To
minimize userland disruption, helper macros are used for the vCPU
arguments passed into and through the shared instruction emulation
code.

A few other APIs used by the instruction emulation code have also been
updated to accept struct vcpu in the kernel including
vm_get/set_register and vm_inject_fault.

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D37161

(cherry picked from commit d3956e46736ffaee5060c9baf0a40f428bc34ec3)

17 months agovmm: Add vm_gpa_hold_global wrapper function.
John Baldwin [Fri, 18 Nov 2022 18:01:57 +0000 (10:01 -0800)]
vmm: Add vm_gpa_hold_global wrapper function.

This handles the case that guest pages are being held not on behalf of
a virtual CPU but globally.  Previously this was handled by passing a
vcpuid of -1 to vm_gpa_hold, but that will not work in the future when
vm_gpa_hold is changed to accept a struct vcpu pointer.

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D37160

(cherry picked from commit 28b561ad9d03617418aed33b9b8c1311e940f0c8)

17 months agovmm: Add _KERNEL guards for io headers shared with userspace.
John Baldwin [Fri, 18 Nov 2022 18:01:51 +0000 (10:01 -0800)]
vmm: Add _KERNEL guards for io headers shared with userspace.

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D37159

(cherry picked from commit 0f435e647645afc68076ff5b005f9366c44413eb)

17 months agobhyve: Remove unused vm and vcpu arguments from vm_copy routines.
John Baldwin [Fri, 18 Nov 2022 18:01:44 +0000 (10:01 -0800)]
bhyve: Remove unused vm and vcpu arguments from vm_copy routines.

The arguments identifying the VM and vCPU are only needed for
vm_copy_setup.

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D37158

(cherry picked from commit 2b4fe856f44ded02f3450bac1782bb49b60b7dd5)

17 months agovmm: Use struct vcpu with the vmm_stat API.
John Baldwin [Fri, 18 Nov 2022 18:01:18 +0000 (10:01 -0800)]
vmm: Use struct vcpu with the vmm_stat API.

The function callbacks still use struct vm and and vCPU index.

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D37157

(cherry picked from commit 3dc3d32ad67b38ab44ed4a7cf3020a0741b47ec1)

17 months agovmm: Expose struct vcpu as an opaque type.
John Baldwin [Fri, 18 Nov 2022 18:01:05 +0000 (10:01 -0800)]
vmm: Expose struct vcpu as an opaque type.

Pass a pointer to the current struct vcpu to the vcpu_init callback
and save this pointer in the CPU-specific vcpu structures.

Add routines to fetch a struct vcpu by index from a VM and to query
the VM and vcpuid from a struct vcpu.

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D37156

(cherry picked from commit 950af9ffc616ee573a1ce6ef0c841e897b13dfc4)

17 months agovmm: Use VLAPIC_CTR* in more places.
John Baldwin [Fri, 18 Nov 2022 18:00:59 +0000 (10:00 -0800)]
vmm: Use VLAPIC_CTR* in more places.

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D37155

(cherry picked from commit d030f941e63f5b20efa14833912aae29ff737fcf)

17 months agovmm vmx: Add VMX_CTR* wrapper macros.
John Baldwin [Fri, 18 Nov 2022 18:00:49 +0000 (10:00 -0800)]
vmm vmx: Add VMX_CTR* wrapper macros.

These macros are similar to VCPU_CTR* but accept a single vmx_vcpu
pointer as the first argument instead of separate vm and vcpuid.

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D37154

(cherry picked from commit 57e0119ef3a95d7faa11c44b1acbb8193aadfb35)

17 months agovmm svm: Add SVM_CTR* wrapper macros.
John Baldwin [Fri, 18 Nov 2022 18:00:38 +0000 (10:00 -0800)]
vmm svm: Add SVM_CTR* wrapper macros.

These macros are similar to VCPU_CTR* but accept a single svm_vcpu
pointer as the first argument instead of separate vm and vcpuid.

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D37153

(cherry picked from commit fca494dad06242aa45d3e722f0c16b405dc8039c)

17 months agovmm: Remove the per-vm cookie argument from vmmops taking a vcpu.
John Baldwin [Fri, 18 Nov 2022 18:00:00 +0000 (10:00 -0800)]
vmm: Remove the per-vm cookie argument from vmmops taking a vcpu.

This requires storing a reference to the per-vm cookie in the
CPU-specific vCPU structure.  Take advantage of this new field to
remove no-longer-needed function arguments in the CPU-specific
backends.  In particular, stop passing the per-vm cookie to functions
that either don't use it or only use it for KTR traces.

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D37152

(cherry picked from commit 869c8d1946eb4feb8ad651abdf87af0e5c0111b4)

17 months agovmm: Refactor storage of CPU-dependent per-vCPU data.
John Baldwin [Fri, 18 Nov 2022 17:59:21 +0000 (09:59 -0800)]
vmm: Refactor storage of CPU-dependent per-vCPU data.

Rather than storing static arrays of per-vCPU data in the CPU-specific
per-VM structure, adopt a more dynamic model similar to that used to
manage CPU-specific per-VM data.

That is, add new vmmops methods to init and cleanup a single vCPU.
The init method returns a pointer that is stored in 'struct vcpu' as a
cookie pointer.  This cookie pointer is now passed to other vmmops
callbacks in place of the integer index.  The index is now only used
in KTR traces and when calling back into the CPU-independent layer.

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D37151

(cherry picked from commit 1aa5150479bf35c90c6770e6ea90e8462cfb6bf9)

17 months agovmm vmx: Add a global bool to indicate if the host has the TSC_AUX MSR.
John Baldwin [Fri, 18 Nov 2022 17:58:56 +0000 (09:58 -0800)]
vmm vmx: Add a global bool to indicate if the host has the TSC_AUX MSR.

A future commit will remove direct access to vCPU structures from
struct vmx, so add a dedicated boolean for this rather than checking
the capabilities for vCPU 0.

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D37269

(cherry picked from commit 73abae4493782e44a3382b15f5563c3f400bf51f)

17 months agovmm: Rework snapshotting of CPU-specific per-vCPU data.
John Baldwin [Fri, 18 Nov 2022 17:58:41 +0000 (09:58 -0800)]
vmm: Rework snapshotting of CPU-specific per-vCPU data.

Previously some per-vCPU state was saved in vmmops_snapshot and other
state was saved in vmmops_vcmx_snapshot.  Consolidate all per-vCPU
state into the latter routine and rename the hook to the more generic
'vcpu_snapshot'.  Note that the CPU-independent per-vCPU data is still
stored in a separate blob as well as the per-vCPU local APIC data.

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D37150

(cherry picked from commit 39ec056e6dbd89e26ee21d2928dbd37335de0ebc)

17 months agovmm svm: Mark all VMCB state caches dirty on vCPU restore.
John Baldwin [Fri, 18 Nov 2022 17:58:22 +0000 (09:58 -0800)]
vmm svm: Mark all VMCB state caches dirty on vCPU restore.

Mark Johnston noticed that this was missing VMCB_CACHE_LBR.  Just set
all the bits as is done in svm_run() rather than trying to clear
individual bits.

Reported by: markj
Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D37259

(cherry picked from commit 19b9dd2e08eda491ab1c181ca5a3659f7e7628fc)

17 months agovmm vmx: Refactor per-vCPU data.
John Baldwin [Fri, 18 Nov 2022 17:58:08 +0000 (09:58 -0800)]
vmm vmx: Refactor per-vCPU data.

Add a struct vmx_vcpu to hold per-vCPU data specific to VT-x and
move parallel arrays out of struct vmx into a single array of
this structure.

While here, dynamically allocate the VMCS, APIC page and PIR
descriptors for each vCPU rather than embedding them.

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D37149

(cherry picked from commit 0f00260c679f8d192f9d673fe4fb94b47a2ac6c5)

17 months agovmm svm: Refactor per-vCPU data.
John Baldwin [Fri, 18 Nov 2022 17:57:48 +0000 (09:57 -0800)]
vmm svm: Refactor per-vCPU data.

- Allocate VMCBs separately to avoid excessive padding in struct
  svm_vcpu.

- Allocate APIC pages dynamically directly in struct vlapic.

- Move vm_mtrr into struct svm_vcpu rather than using a separate
  parallel array.

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D37148

(cherry picked from commit 215d2fd53f6c254cb900e1775abae86d3fdada65)

17 months agovmm: Use vm_get_maxcpus() instead of VM_MAXCPU in various places.
John Baldwin [Fri, 18 Nov 2022 17:57:38 +0000 (09:57 -0800)]
vmm: Use vm_get_maxcpus() instead of VM_MAXCPU in various places.

Mostly these are loops that iterate over all possible vCPU IDs for a
specific virtual machine.

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D37147

(cherry picked from commit 35abc6c238e98e313c5b1cb5ed18b8ed68615abc)

17 months agovmm: Simplify saving of absolute TSC values in snapshots.
John Baldwin [Fri, 18 Nov 2022 17:57:29 +0000 (09:57 -0800)]
vmm: Simplify saving of absolute TSC values in snapshots.

Read the current "now" TSC value and use it to compute absolute time
saved value in vm_snapshot_vcpus rather than iterating over vCPUs
multiple times in vm_snapshot_vm.

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D37146

(cherry picked from commit a7db532e3a6f83067b342f569b56076d011f8a1e)

17 months agobhyve: Avoid passing a possible garbage pointer to free().
John Baldwin [Tue, 29 Nov 2022 01:10:30 +0000 (17:10 -0800)]
bhyve: Avoid passing a possible garbage pointer to free().

All of the error paths in pci_vtcon_sock_add free the sock pointer.
However, sock is not initialized until part way through the function.
An early error would pass stack garbage to free().

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D37491

(cherry picked from commit bc928800723b65daa9b005bec4ffd8ad8c781a09)

17 months agobhyve: Appease warning about a potentially unaligned pointer.
John Baldwin [Tue, 29 Nov 2022 01:10:07 +0000 (17:10 -0800)]
bhyve: Appease warning about a potentially unaligned pointer.

When initializing the device model for a PCI pass through device that
uses MSI-X, bhyve reads the MSI-X capability from the real device to
save a copy in the emulated PCI config space.  It also saves a copy in
a local struct msixcap on the stack.  Since struct msixcap is packed,
GCC complains that casting a pointer to the struct to a uint32_t
pointer may result in an unaligned pointer.

This path is not performance critical, so to appease the compiler,
simply change the pointer to a char * and use memcpy to copy the 4
bytes read in each iteration of the loop.

Reviewed by: corvink, bz, markj
Differential Revision: https://reviews.freebsd.org/D37490

(cherry picked from commit 32b21dd2719f87811b66deeeb513acf7067f8fac)

17 months agobhyve: Fix sign compare warnings in the NVMe device model.
John Baldwin [Tue, 29 Nov 2022 01:09:44 +0000 (17:09 -0800)]
bhyve: Fix sign compare warnings in the NVMe device model.

Reviewed by: corvink
Differential Revision: https://reviews.freebsd.org/D37489

(cherry picked from commit 15cebe3d637f70abd1ee95e2745d6676d9b1e7dd)

17 months agobhyve: Avoid unlikely truncation of the blockif ident strings.
John Baldwin [Tue, 29 Nov 2022 01:09:15 +0000 (17:09 -0800)]
bhyve: Avoid unlikely truncation of the blockif ident strings.

The ident string for NVMe and VirtIO block deivces do not contain the
bus, and the various fields can potentially use up to three characters
when printed as unsigned values (full range of uint8_t) even if not
likely in practice.

Reviewed by: corvink, chuck
Differential Revision: https://reviews.freebsd.org/D37488

(cherry picked from commit 5d805962ca9347bbf62750452c4c980decb94793)

17 months agobhyve: Clear lid to 0 for internal device errors for NVMe AENs.
John Baldwin [Tue, 29 Nov 2022 01:08:57 +0000 (17:08 -0800)]
bhyve: Clear lid to 0 for internal device errors for NVMe AENs.

Reported by: GCC
Reviewed by: corvink, chuck, imp, markj
Differential Revision: https://reviews.freebsd.org/D37487

(cherry picked from commit 47d61162396bac8a7320a6768f218b192dd19ee1)

17 months agobhyve: Don't leak uninitialized bits in NVMe completion statuses.
John Baldwin [Tue, 29 Nov 2022 01:08:36 +0000 (17:08 -0800)]
bhyve: Don't leak uninitialized bits in NVMe completion statuses.

In some cases, some bits in the 16-bit status word were never
initialized.

Reported by: GCC
Reviewed by: corvink, chuck, markj
Differential Revision: https://reviews.freebsd.org/D37486

(cherry picked from commit 1d9e8a9e60953b148a036b39d1fe7037fdbb40a3)

17 months agobhyve: Fix sign compare warnings in the e1000 device model.
John Baldwin [Tue, 29 Nov 2022 01:08:09 +0000 (17:08 -0800)]
bhyve: Fix sign compare warnings in the e1000 device model.

Adding a bare constant to a uint16_t promotes to a signed int which
triggers these warnings.  Changing the constant to be explicitly
unsigned instead promotes the expression to unsigned int.

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D37485

(cherry picked from commit e7cd5ffff88f1f4dfba2693041cc78fcf3613fba)

17 months agobhyve basl: Use GCC pragmas.
John Baldwin [Tue, 29 Nov 2022 01:07:39 +0000 (17:07 -0800)]
bhyve basl: Use GCC pragmas.

These work with both clang and GCC.

Reviewed by: corvink, markj
Differential Revision: https://reviews.freebsd.org/D37484

(cherry picked from commit 0acf696151e3c43967988c8271aa27683566a755)

17 months agobhyve: Enable the default compiler warnings
Mark Johnston [Fri, 18 Nov 2022 19:10:33 +0000 (14:10 -0500)]
bhyve: Enable the default compiler warnings

Disable -Wcast-align for now since we have many instances of that
warning (I fixed some but not most of them) and platforms on which bhyve
runs don't particularly care about unaligned accesses.

Reviewed by: corvink
Differential Revision: https://reviews.freebsd.org/D37296

(cherry picked from commit 71ebd117386cda6410ca65eb487b63e5dedf3245)

17 months agobhyve: Mark pci_de_vinput as static.
John Baldwin [Thu, 26 Jan 2023 20:19:12 +0000 (12:19 -0800)]
bhyve: Mark pci_de_vinput as static.

Originally in main this was fixed in commit 37045dfa891a.  However,
when that commit was merged to stable/13 in commit 976ed044fbbb,
pci_virtio_input was not yet merged to stable/13.  This is a direct
commit to complete the earlier MFC.

17 months agobhyve: Let BASL compile with raised warnings
Mark Johnston [Fri, 18 Nov 2022 19:07:20 +0000 (14:07 -0500)]
bhyve: Let BASL compile with raised warnings

- Make basl_dump() as unused.
- Avoid arithmetic on a void pointer.
- Avoid a signed/unsigned comparison with
  BASL_TABLE_CHECKSUM_LEN_FULL_TABLE.
- Ignore warnings about unused parameters from stuff pulled in by
  acpi.h.  In particular, any prototype wrapped by
  ACPI_DBG_DEPENDENT_RETURN_VOID() will raise such parameters unless
  ACPI_DEBUG_OUTPUT is defined.

Reviewed by: corvink, jhb
Differential Revision: https://reviews.freebsd.org/D37397

(cherry picked from commit c127c61efa4d8414be9a7373b50c7f348b6e461e)

17 months agobhyve: Avoid using a packed struct for xhci port registers
Mark Johnston [Fri, 18 Nov 2022 19:07:38 +0000 (14:07 -0500)]
bhyve: Avoid using a packed struct for xhci port registers

I believe the __packed annotation is there only because
pci_xhci_portregs_read() is treating the register set as an array of
uint32_t.  clang warns about taking the address of portregs->portsc
because it is a packed member and thus might not have expected
alignment.

Fix the problem by simply selecting the field to read with a switch
statement.  This mimics pci_xhci_portregs_write().  While here, switch
to using some symbolic constants.

There is a small semantic change here in that pci_xhci_portregs_read()
would silently truncate unaligned offsets.  For consistency with
pci_xhci_portregs_write(), which does not do that, return all ones for
unaligned reads instead.

MFC after: 2 weeks
Reviewed by: corvink, jhb
Differential Revision: https://reviews.freebsd.org/D37408

(cherry picked from commit 0705b7f4e64fdbad49a3a6d9131029a9734deb2c)

17 months agobhyve: Fix a typo in a comment
Mark Johnston [Mon, 14 Nov 2022 14:00:06 +0000 (09:00 -0500)]
bhyve: Fix a typo in a comment

Reported by: MikaĆ«l Urankar <mikael.urankar@mailo.fr>
Fixes: 719e307f80c7 ("bhyve: Cast away const when fetching a config nvlist")

(cherry picked from commit 84b0b7ea4cd6731e91f79e008a747b502106f95a)

17 months agobhyve: Address warnings about potential unaligned accesses in fwctl.c
Mark Johnston [Fri, 11 Nov 2022 15:01:27 +0000 (10:01 -0500)]
bhyve: Address warnings about potential unaligned accesses in fwctl.c

This silences some warning about potential unaligned accesses.  No
functional change intended.

MFC after: 1 week
Reviewed by: corvink, jhb
Differential Revision: https://reviews.freebsd.org/D37288

(cherry picked from commit f64f34380925a4ddaf1c140c35f46408b74110ac)

17 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

(cherry picked from commit 1d21f64149224000d74e0c850686e85aefd25ef9)

17 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

(cherry picked from commit ae71263c6689a475f3df293475058048c0810dd7)

17 months agobhyve: Address signed/unsigned comparison warnings in the AHCI model
Mark Johnston [Tue, 25 Oct 2022 13:39:07 +0000 (09:39 -0400)]
bhyve: Address signed/unsigned comparison warnings in the AHCI model

No functional change intended.

MFC after: 1 week

(cherry picked from commit f0553616cf78c94e7589921d2354477b948e4876)

17 months agobhyve: Address some signed/unsigned comparison warnings
Mark Johnston [Sun, 23 Oct 2022 14:32:45 +0000 (10:32 -0400)]
bhyve: Address some signed/unsigned comparison warnings

MFC after: 1 week

(cherry picked from commit ed7216843133c9d6748251b5e180ee90410131f0)

17 months agobhyve: Address signed/unsigned comparison warnings in the e1000 model
Mark Johnston [Tue, 25 Oct 2022 13:54:50 +0000 (09:54 -0400)]
bhyve: Address signed/unsigned comparison warnings in the e1000 model

No functional change intended.

MFC after: 1 week

(cherry picked from commit cea34d0705ccd3944cce1bed5b4ff31aad05d983)

17 months agobhyve: Address warnings in blockif_proc()
Mark Johnston [Tue, 25 Oct 2022 13:16:23 +0000 (09:16 -0400)]
bhyve: Address warnings in blockif_proc()

- Use unsigned types for all arithmetic.  Use a new signed variable for
  holding the return value of pread() and pwrite().
- Handle short I/O from pwrite().

MFC after: 1 week

(cherry picked from commit 46f5c828961e64646c46ff9e3bc8e55f46f3e7bb)

17 months agobhyve: Drop a bogus const qualifier
Mark Johnston [Mon, 24 Oct 2022 21:35:16 +0000 (17:35 -0400)]
bhyve: Drop a bogus const qualifier

No functional change intended.

MFC after: 1 week

(cherry picked from commit eefd863cbae9d7b2f5c83948b45be13951a0c495)

17 months agobhyve: Put the prototype for vmexit_task_switch() in a header
Mark Johnston [Sun, 23 Oct 2022 14:21:50 +0000 (10:21 -0400)]
bhyve: Put the prototype for vmexit_task_switch() in a header

No functional change intended.

MFC after: 1 week

(cherry picked from commit f703dc0ef0e1d6ac1697cb8d6662870bd5e0fba6)

17 months agobhyve: Annotate an unused function as such
Mark Johnston [Sun, 23 Oct 2022 14:46:39 +0000 (10:46 -0400)]
bhyve: Annotate an unused function as such

No functional change intended.

MFC after: 1 week

(cherry picked from commit eb805f4e0f6a7b1567aa4cf4eb1c4484dac67ae5)

17 months agobhyve: USB device model structures can be qualified with "static"
Mark Johnston [Sat, 22 Oct 2022 17:39:01 +0000 (13:39 -0400)]
bhyve: USB device model structures can be qualified with "static"

No functional change intended.

MFC after: 1 week

(cherry picked from commit cd49c066a3565a37551d50d759c8d1b5a90b3859)

17 months agobhyve: Fix some warnings in the snapshot code
Mark Johnston [Sat, 22 Oct 2022 17:41:33 +0000 (13:41 -0400)]
bhyve: Fix some warnings in the snapshot code

- Qualify unexported symbols with "static".
- Drop some unnecessary and incorrect casts.
- Avoid arithmetic on void pointers.
- Avoid signed/unsigned comparisons in loops which use nitems() as a
  bound.

No functional change intended.

MFC after: 1 week

(cherry picked from commit c9faf6987406781debb06ec5e40aa1de6d11ac4f)

17 months agobhyve: Put the prototype for vga_render() in a header
Mark Johnston [Sun, 23 Oct 2022 14:22:39 +0000 (10:22 -0400)]
bhyve: Put the prototype for vga_render() in a header

No functional change intended.

MFC after: 1 week

(cherry picked from commit 84633b9d5244c5bd0438d2969e021ec01066b107)

17 months agobhyve: Use the proper type for string literals
Mark Johnston [Sat, 22 Oct 2022 17:37:46 +0000 (13:37 -0400)]
bhyve: Use the proper type for string literals

No functional change intended.

MFC after: 1 week

(cherry picked from commit 7039bdd5351a080e648c6519636227bcd38a255c)

17 months agobhyve: Avoid arithmetic on void pointers
Mark Johnston [Sat, 22 Oct 2022 17:40:20 +0000 (13:40 -0400)]
bhyve: Avoid arithmetic on void pointers

No functional change intended.

MFC after: 1 week

(cherry picked from commit 63898728b544763d85c062c8515c12a0c3a60e0a)

17 months agobhyve: Address some warnings in bhyverun.c
Mark Johnston [Sat, 22 Oct 2022 17:34:00 +0000 (13:34 -0400)]
bhyve: Address some warnings in bhyverun.c

- Annotate unused parameters as such.
- Avoid shadowing the global "vmexit".

No functional change intended.

MFC after: 1 week

(cherry picked from commit 4a1c23a708f98c1588a196041cda5d55795e2f0c)

17 months agobhyve: Make hda_ops function tables const
Mark Johnston [Sun, 23 Oct 2022 14:43:06 +0000 (10:43 -0400)]
bhyve: Make hda_ops function tables const

No functional change intended.

MFC after: 1 week

(cherry picked from commit 489392feb7dd784b6036dd6511c690e4df9726e3)

17 months agobhyve: Annotate unused function parameters
Mark Johnston [Sat, 8 Oct 2022 15:22:38 +0000 (11:22 -0400)]
bhyve: Annotate unused function parameters

MFC after: 1 week

(cherry picked from commit 98d920d9cf0b439ea351c60353626946971684f6)

17 months agobhyve: Use designated initializers for virtio_consts tables
Mark Johnston [Thu, 29 Sep 2022 15:53:04 +0000 (11:53 -0400)]
bhyve: Use designated initializers for virtio_consts tables

This is easier to read and addresses some compiler warnings.

One might expect these tables to be read-only but it seems that the
snapshot/restore code may modify them.

MFC after: 2 weeks

(cherry picked from commit 6cb261620da3a9888f7a09244a8efe691c12ae47)

17 months agobhyve: Address some warnings in bhyverun.c
Mark Johnston [Thu, 8 Sep 2022 23:08:10 +0000 (19:08 -0400)]
bhyve: Address some warnings in bhyverun.c

- Add const and __unused qualifiers where appropriate.
- Localize some global variables.
- Consistently spell vmexit state as "vme" in vmexit handlers, to avoid
  shadowing the global vm_exit state array.
- Similarly, avoid shadowing "optarg".

MFC after: 2 weeks

(cherry picked from commit 65b8109b4e07ea1fe105ab10539d5baa0a613a14)

17 months agobhyve nvme: Fix Controller init error cases
Chuck Tuffli [Sun, 14 Aug 2022 14:47:34 +0000 (07:47 -0700)]
bhyve nvme: Fix Controller init error cases

Fuzzing of bhyve uncovered an assertion failure in the NVMe emulation.
Investigation uncovered several corner cases the code did not handle.
This change handles several Controller initialization errors, including
 - bad AQ sizes
 - bad AQ vm_map_gpa
 - doorbell writes prior to RDY
 - doorbell writes to uninitialized queue
 - CSTS.RDY if CFS set

PR: 256317,256319,256320,256322
Reported by: Cheolwoo Myung <cwmyung@snu.ac.kr>
Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D35453

(cherry picked from commit d7d1becad4b692b97dd1f32706947aae5118294b)

17 months agovmm: Fix snapshots for AMD CPUs
Mihai Burcea [Thu, 30 Jun 2022 23:11:17 +0000 (16:11 -0700)]
vmm: Fix snapshots for AMD CPUs

This patch fixes the AMD implementation for snapshotting.  It removes
unnecessary vmcb fields that should not be saved and duplicates.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D33431

(cherry picked from commit 9aa02d5120ab02bcbbc16fddb63e575df4ed6f61)

17 months agolibvmmapi: Add vm_close()
Vitaliy Gusev [Thu, 30 Jun 2022 21:21:57 +0000 (14:21 -0700)]
libvmmapi: Add vm_close()

Currently there is no way to safely free a vm structure without
leaking the fd.  vm_destroy() closes the fd but also destroys the VM
whereas in some cases a VM needs to be opened (vm_open) and then
closed (vm_close).

Reviewed by: jhb
Sponsored by: vStack
Differential Revision: https://reviews.freebsd.org/D35073

(cherry picked from commit f0880ab791a510391a12f2ab7b01889b6774bca0)

17 months agobhyve: Snapshot impovements for 'blockif' backend
Vitaliy Gusev [Thu, 23 Jun 2022 18:46:06 +0000 (11:46 -0700)]
bhyve: Snapshot impovements for 'blockif' backend

When pausing a block I/O device model as part of suspending a VM, wait
for all active block I/O requests to finish before saving snapshot
data.  This avoids having to save information about in-flight requests
both in the block_if layer and in storage device models.

For the AHCI device model, the queues are now guaranteed to be idle
when taking a snapshot, so remove the code to save queue state and
rely on the initial state in a resumed VM having all queues already
idle.

This will also simplify adding NVMe snapshot support in the future.

Reviewed by: jhb
Sponsored by: vStack
Differential Revision: https://reviews.freebsd.org/D26267

(cherry picked from commit cd9618bdb274375139080ee4e33ccbdc980513f3)

17 months agobhyve: Enable suspend/resume support for virtio-blk.
Vitaliy Gusev [Thu, 23 Jun 2022 18:46:06 +0000 (11:46 -0700)]
bhyve: Enable suspend/resume support for virtio-blk.

Reviewed by: jhb
Sponsored by: vStack
Differential Revision: https://reviews.freebsd.org/D26267

(cherry picked from commit a85bbbea91bddbd27d080fb2ad55a9f5c316adad)

17 months agobhyve: Report an error for invalid UUIDs.
James Mintram [Thu, 16 Jun 2022 20:17:44 +0000 (13:17 -0700)]
bhyve: Report an error for invalid UUIDs.

Reviewed by: rgrimes, grehan, jhb
Differential Revision: https://reviews.freebsd.org/D30050

(cherry picked from commit e16b709e2dcc45f01cf96b5e7f6d48474feff8d7)

17 months agovmm_instruction_emul.c: fix bhyve build
Robert Wing [Sun, 10 Apr 2022 21:37:24 +0000 (13:37 -0800)]
vmm_instruction_emul.c: fix bhyve build

The __diagused macro was used to cure a "set but not used" warning. This
broke the build for bhyve since __diagused is only defined in the
kernel. Define __diagused when not building the kernel.

Fixes: 5241577a223d ("vmm: fix set but not used warning")
Reported by:    Jenkins

(cherry picked from commit d4e8207317ca1827ba2529203d5cc4e67d836fcb)

17 months agovmm: fix set but not used warning
Robert Wing [Sun, 10 Apr 2022 18:30:19 +0000 (10:30 -0800)]
vmm: fix set but not used warning

(cherry picked from commit 5a17f489d5848085307e1d5fa7ca142694b4946b)

17 months agovmm: fix set but not used warning
Robert Wing [Sun, 10 Apr 2022 18:30:16 +0000 (10:30 -0800)]
vmm: fix set but not used warning

(cherry picked from commit 5241577a223d805282f726cb443a566aca653b9f)

17 months agovmm: fix set but not used warning
Robert Wing [Sun, 10 Apr 2022 18:30:14 +0000 (10:30 -0800)]
vmm: fix set but not used warning

(cherry picked from commit 3587bfa797cd66dce2e94ca93df5ce41def555df)

17 months agovmm: fix set but not used warnings
Robert Wing [Sun, 10 Apr 2022 18:30:11 +0000 (10:30 -0800)]
vmm: fix set but not used warnings

(cherry picked from commit 5c272efaba291f744191dca86f04418bfe90b222)

17 months agovmm: fix set but not used warnings
Robert Wing [Sun, 10 Apr 2022 18:30:08 +0000 (10:30 -0800)]
vmm: fix set but not used warnings

(cherry picked from commit f877977a034b41bedacdf507e79e4233b28a8bfc)

17 months agovmm: fix set but not used warning
Robert Wing [Sun, 10 Apr 2022 18:30:05 +0000 (10:30 -0800)]
vmm: fix set but not used warning

(cherry picked from commit 893a3dd697ef4ac0a432ca8ce8790661884eb1ea)

17 months agoFix a typo in previous commit.
John Baldwin [Fri, 8 Apr 2022 19:01:33 +0000 (12:01 -0700)]
Fix a typo in previous commit.

Reported by: npn
Pointy hat to: jhb
Fixes: 572edd3dae9f vmm: Re-quiet set but unused warnings.

(cherry picked from commit 6a33ecdc2f649234cc3160daec8c329f33860f45)

17 months agovmm amdvi: Move ctrl under #ifdef AMDVI_DEBUG_CMD.
John Baldwin [Fri, 8 Apr 2022 00:01:29 +0000 (17:01 -0700)]
vmm amdvi: Move ctrl under #ifdef AMDVI_DEBUG_CMD.

(cherry picked from commit a7d876f7010068d93f1d9b4bb62d1370c9a0798f)

17 months agovmm: Re-quiet set but unused warnings.
John Baldwin [Fri, 8 Apr 2022 00:01:29 +0000 (17:01 -0700)]
vmm: Re-quiet set but unused warnings.

__diagused is no longer used for KTR, so instead use #ifdef KTR or
expand KTR-only variables into their values in traces.

(cherry picked from commit 572edd3dae9fc3e67dfb1cb9ba023e8d3fe2a9bb)

17 months agovmm: fix "set but not used" warnings
Robert Wing [Tue, 1 Mar 2022 00:09:32 +0000 (15:09 -0900)]
vmm: fix "set but not used" warnings

(cherry picked from commit 2062ce996ddd39ba7a36c2caf8c898686d9cb2fe)

17 months agovmm: fix "set but not used" warnings
Robert Wing [Mon, 28 Feb 2022 23:55:37 +0000 (14:55 -0900)]
vmm: fix "set but not used" warnings

(cherry picked from commit 39d87a023567f633c6990ac7fcc3a20691a1efd6)

17 months agovmm: fix "set but not used" warnings
Robert Wing [Mon, 28 Feb 2022 23:46:08 +0000 (14:46 -0900)]
vmm: fix "set but not used" warnings

(cherry picked from commit 73505a10760c8b6f459b9c790bbf3a365f990a0b)

17 months agobhyve: Fix virtio-console legacy configuration parsing
Yan Ka Chiu [Fri, 6 May 2022 19:31:56 +0000 (15:31 -0400)]
bhyve: Fix virtio-console legacy configuration parsing

virtio-console is currently missing .pe_legacy_config, which prevents any
portN configuration from being parsed, and therefore no sockets will be
created.

Reviewed by: khng
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D35142

(cherry picked from commit 3cdfaefa4b88c928bfb62e7fb6c7f7742d81f31c)

17 months agoman pages: Fix typo
Christian Weisgerber [Wed, 6 Apr 2022 14:46:39 +0000 (16:46 +0200)]
man pages: Fix typo

s/the the/the/

Approved by: ygy (doc)

(cherry picked from commit 81d1214e8a9435aa7c09b622fa6916e89138dc5c)

17 months agobhyve: missing mutex initializations
Andy Fiddaman [Wed, 16 Mar 2022 03:50:36 +0000 (19:50 -0800)]
bhyve: missing mutex initializations

Explicitly initialize the mutex that a PCI virtio module passes back to
virtio.

It so happens that these mutexes were being initialized regardless, no
functional change intended.

Reviewed by:    chuck, jhb
Differential Revision:  https://reviews.freebsd.org/D34372

(cherry picked from commit f6f357efb1067b79678d8f348333ffdfec66ad20)

17 months agobhyve: plug memory leak in topology_parse()
Andy Fiddaman [Thu, 24 Feb 2022 17:36:41 +0000 (08:36 -0900)]
bhyve: plug memory leak in topology_parse()

Reviewed by:    jhb, rew
Differential Revision:  https://reviews.freebsd.org/D34301

(cherry picked from commit ad3da82996ffe8a7959fda4a84374b1907ebb116)

17 months agobhyve: Fix getaddrinfo() error handling
Mark Johnston [Tue, 8 Feb 2022 17:34:03 +0000 (12:34 -0500)]
bhyve: Fix getaddrinfo() error handling

- Use errx() since errno will not be set.
- Print the message returned by gai_strerror().

MFC after: 1 week
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 927aa5fefd4c69e72d44189a04fadf80e42d0ad8)

17 months agobhyve: clean up trailing whitespaces
Toomas Soome [Sun, 26 Dec 2021 07:52:38 +0000 (09:52 +0200)]
bhyve: clean up trailing whitespaces

Clean up trailing whitespaces. No functional changes.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D33681

(cherry picked from commit c2fa905cf6c1cf1938a0353679e3bd0b617ca179)

17 months agobhyve.8: Fix markup of the -G flag
Mateusz Piotrowski [Tue, 12 Oct 2021 14:06:52 +0000 (16:06 +0200)]
bhyve.8: Fix markup of the -G flag

(cherry picked from commit 775f6f459595c5373ab389a43bdf1a8467233f1a)

17 months agobhyve: Fix pci device node key in bhyve_config.5
Ka Ho Ng [Sun, 12 Sep 2021 20:31:19 +0000 (04:31 +0800)]
bhyve: Fix pci device node key in bhyve_config.5

PCI device node key in the manual page is wrong. It should be
pci.bus.slot.function.

MFC after: 3 days

(cherry picked from commit e31cc1d526dcdfcbe5666deb8b11decc5126a871)

17 months agobhyve: change a default address from ANY to localhost
Mariusz Zaborski [Thu, 19 Aug 2021 18:00:35 +0000 (20:00 +0200)]
bhyve: change a default address from ANY to localhost

Discussed with:     grehan, jhb

(cherry picked from commit 3a92927bb69f2d3fcd3dec4c909aab2191f4b848)

17 months agobhyve: enhance debug info for memory range clash
Robert Crowston [Sat, 10 Apr 2021 19:16:02 +0000 (20:16 +0100)]
bhyve: enhance debug info for memory range clash

Explain what the two clashing regions are.

Reivewed by: grehan, jhb
Differential Revision: https://reviews.freebsd.org/D29696
Pull Request: https://github.com/freebsd/freebsd-src/pull/463

(cherry picked from commit efec757b20425ac68171acc7f9cec8be750db688)

17 months agobhyve: Fix build when BHYVE_SNAPSHOT is set
Filipe da Silva Santos [Tue, 13 Sep 2022 06:30:41 +0000 (08:30 +0200)]
bhyve: Fix build when BHYVE_SNAPSHOT is set

Fixes: 9cc9abf409cc ("bhyve: create all vcpus on startup")
Sponsored by: Beckhoff Automation GmbH & Co. KG
X-MFC-With: 9cc9abf409cc

(cherry picked from commit 10c6af344108a8cfdc431b5b304de9c0fddcec47)

17 months agobhyve/snapshot: ..back to SOCK_STREAM
Robert Wing [Thu, 28 Apr 2022 15:43:01 +0000 (07:43 -0800)]
bhyve/snapshot: ..back to SOCK_STREAM

Now that nvlist_send()/nvlist_recv() are being used, ditch the datagram
socket.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D34863

(cherry picked from commit 690b7ea081790eef2c890f63a4fe7e195cf51df0)

17 months agobhyve: use linker set for ipc commands
Robert Wing [Sun, 10 Apr 2022 02:46:00 +0000 (18:46 -0800)]
bhyve: use linker set for ipc commands

Reviewed by: markj, jhb
Differential Revision: https://reviews.freebsd.org/D34760

(cherry picked from commit c79331a42c308139828c1117f49224bb83617a53)

17 months agobhyve: sweep MAX_VMNAME
Robert Wing [Fri, 18 Mar 2022 05:55:52 +0000 (21:55 -0800)]
bhyve: sweep MAX_VMNAME

MAX_VMNAME is no longer used.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D34292

(cherry picked from commit 3ebe1109348f53f64b395293578416abedef4090)

17 months agobhyve/snapshot: limit snapshot filename to NAME_MAX
Robert Wing [Fri, 18 Mar 2022 05:51:31 +0000 (21:51 -0800)]
bhyve/snapshot: limit snapshot filename to NAME_MAX

NAME_MAX is a better fit since strcat_extension() constructs the
filename of the snapshot file.

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D34291

(cherry picked from commit 961e6a12efdbd48d92516beaf0772ff50008457d)

17 months agolibvmm: constify vm_get_name()
Robert Wing [Fri, 18 Mar 2022 05:26:54 +0000 (21:26 -0800)]
libvmm: constify vm_get_name()

Allows callers of vm_get_name() to retrieve the vm name without having
to allocate a buffer.

While in the vicinity, do minor cleanup in vm_snapshot_basic_metadata().

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D34290

(cherry picked from commit 3efc45f34e13c63cb37a77a67fea39937004b75a)

17 months agobhyvectl: drop vm_get_name()
Robert Wing [Fri, 18 Mar 2022 05:22:43 +0000 (21:22 -0800)]
bhyvectl: drop vm_get_name()

Grab the vm name from bhyvectl's --vm flag instead.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D34399

(cherry picked from commit ee0ebaa42028aee9886e06b6b995c8b2389e89f4)

17 months agobhyve/snapshot: use a string for cmd element in the nvlist
Robert Wing [Tue, 15 Feb 2022 17:12:15 +0000 (08:12 -0900)]
bhyve/snapshot: use a string for cmd element in the nvlist

The nvlist for a checkpoint request will now look like:

    { cmd="checkpoint", suspend="true/false", filename="afilename" }

Reviewed by: jhb
Suggested by:   jhb
Differential Revision: https://reviews.freebsd.org/D34237

(cherry picked from commit 4379c1da56faa43ecc925e47707a2f51b488614e)

17 months agobhyve/snapshot: switch to nvlist for snapshot requests
Robert Wing [Wed, 9 Feb 2022 17:11:57 +0000 (08:11 -0900)]
bhyve/snapshot: switch to nvlist for snapshot requests

Switch to using an nvlist with nvlist_send()/nvlist_recv() to
communicate from bhyvectl(8) to bhyve(8).

The idea is that a bhyve process receives a command with with a set of
arguments. The nvlist here is structured to reflect that premise.

For example, to snapshot the vm, the expected nvlist looks like:

    { cmd=START_CHECKPOINT, filename="filename" }

Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D33977

(cherry picked from commit edfb339d3868bbd36393efb2738287e170767784)

17 months agobhyve/snapshot: fix pthread_create() error check
Robert Wing [Wed, 19 Jan 2022 17:40:06 +0000 (08:40 -0900)]
bhyve/snapshot: fix pthread_create() error check

pthread_create() returns 0 on success or an error number on failure.

Reviewed by: khng, markj
Differential Revision: https://reviews.freebsd.org/D33930

(cherry picked from commit 51fbd894ddadd6a1bc4cb72de8ac4e92c013bd36)

17 months agobhyve/snapshot: split up mutex/cond initialization from socket creation
Robert Wing [Sat, 15 May 2021 19:58:21 +0000 (11:58 -0800)]
bhyve/snapshot: split up mutex/cond initialization from socket creation

Move initialization of the mutex/condition variables required by the
save/restore feature to their own function.

The unix domain socket that facilitates communication between bhyvectl
and bhyve doesn't rely on these variables in order to be functional.

Reviewed by:    markj
Differential Revision:  https://reviews.freebsd.org/D30281

(cherry picked from commit fdbc86cf79784f56fab8115f2d565962e1111b2e)

17 months agobhyve/snapshot: provide a way to send other messages/data to bhyve
Robert Wing [Wed, 3 Mar 2021 06:05:47 +0000 (21:05 -0900)]
bhyve/snapshot: provide a way to send other messages/data to bhyve

This is a step towards sending messages (other than suspend/checkpoint)
from bhyvectl to bhyve.

Introduce a new struct, ipc_message - this struct stores the type of
message and a union containing message specific structures for the type
of message being sent.

Reviewed by:    grehan
Differential Revision: https://reviews.freebsd.org/D30221

(cherry picked from commit d4870e3a7256704905655e997b37a866024c2894)

17 months agobhyve/snapshot: use SOCK_DGRAM instead of SOCK_STREAM
Robert Wing [Mon, 8 Mar 2021 00:23:29 +0000 (15:23 -0900)]
bhyve/snapshot: use SOCK_DGRAM instead of SOCK_STREAM

The save/restore feature uses a unix domain socket to send messages
from bhyvectl(8) to a bhyve(8) process. A datagram socket will suffice
for this.

An added benefit of using a datagram socket is simplified code. For
bhyve, the listen/accept calls are dropped; and for bhyvectl, the
connect() call is dropped.

EPRINTLN handles raw mode for bhyve(8), use it to print error messages.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D28983

(cherry picked from commit 38dfb0626fd35c64b2e2d5faae2c90e7981a3307)

17 months agobhyve/snapshot: rename and bump size of MAX_SNAPSHOT_VMNAME
Robert Wing [Sat, 27 Feb 2021 21:07:35 +0000 (12:07 -0900)]
bhyve/snapshot: rename and bump size of MAX_SNAPSHOT_VMNAME

MAX_SNAPSHOT_VMNAME is a macro used to set the size of a character
buffer that stores a filename or the path to a file - this file is used
by the save/restore feature.

Since the file doesn't have anything to do with a vm name, rename
MAX_SNAPSHOT_VMNAME to MAX_SNAPSHOT_FILENAME. Bump the size to PATH_MAX
while here.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D28879

(cherry picked from commit d656ce199d72f1aeeef1b2e28b4a284c968a8d03)

17 months agobhyvectl: reduce code duplication
Robert Wing [Sat, 27 Feb 2021 21:05:52 +0000 (12:05 -0900)]
bhyvectl: reduce code duplication

Combine send_start_checkpoint() and send_start_suspend() into a
single function named snapshot_request().

snapshot_request() is equivalent to send_start_checkpoint() and
send_start_suspend() except that it takes an additional argument. The
additional argument, enum ipc_opcode, is used to determine the type of
snapshot request being performed. Also, switch to using strlcpy instead
of strncpy.

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D28878

(cherry picked from commit da9713917eb26b67bafc740384ccd44f7dff09f2)

17 months agobhyve/snapshot: rename checkpoint_opcodes to be more generic
Robert Wing [Sat, 27 Feb 2021 21:03:03 +0000 (12:03 -0900)]
bhyve/snapshot: rename checkpoint_opcodes to be more generic

Generalize the naming here since the domain socket that uses these codes
might be used for purposes other than the save/restore feature.

- rename checkpoint_opcodes to ipc_opcode

Reviewed by: jhb
Differential Revision: https://reviews.freebsd.org/D28877

(cherry picked from commit b7fd9c4e5ebc69934205980d9f628ef8f21fb288)