Revision tags: release/14.2.0, release/13.4.0 |
|
#
0b32ef71 |
| 11-Sep-2024 |
Joshua Rogers <Joshua@Joshua.Hu> |
vmm: Correctly suspend and resume the vmm driver.
Previously, VMXON would be executed on a resume, contrary to proper initalization. The contents of MSR_IA32_FEATURE_CONTROL may be lost on suspensio
vmm: Correctly suspend and resume the vmm driver.
Previously, VMXON would be executed on a resume, contrary to proper initalization. The contents of MSR_IA32_FEATURE_CONTROL may be lost on suspension, therefore must be restored. Likewise, the VMX Enable bit may be cleared upon suspend, requiring it to be re-set.
Concretely disable VMX on suspend, and re-enable it on resume.
Note: any IOMMU context will remain lost for any enabled vmm devices.
Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu> Reviewed by: jhb,imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1419
show more ...
|
#
f3754afd |
| 12-Sep-2024 |
Joshua Rogers <Joshua@Joshua.Hu> |
Remove stray whitespaces from sys/amd64/
Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1418
|
#
3ccb0233 |
| 26-Aug-2024 |
Mark Johnston <markj@FreeBSD.org> |
vmm: Move vmm_ktr.h to a common directory
No functional change intended.
Reviewed by: corvink, jhb, emaste Differential Revision: https://reviews.freebsd.org/D46429
|
Revision tags: release/14.1.0, release/13.3.0 |
|
#
f493ea65 |
| 07-Feb-2024 |
Mark Johnston <markj@FreeBSD.org> |
vmm: Expose more registers to VM_GET_REGISTER
In a follow-up revision the gdb stub will support sending an XML target description to gdb, which lets us send additional registers, including the ones
vmm: Expose more registers to VM_GET_REGISTER
In a follow-up revision the gdb stub will support sending an XML target description to gdb, which lets us send additional registers, including the ones added in this patch.
Reviewed by: jhb MFC after: 1 month Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D43665
show more ...
|
#
683ea4d2 |
| 29-Dec-2023 |
Vitaliy Gusev <gusev.vitaliy@gmail.com> |
vmm: MTRR should be saved/restored
This fixes restoring a Linux VM if it was suspended while in the GRUB menu.
Adding MTTR increases the kernel dump size by 256 bytes per vCPU.
Sponsored by: vSt
vmm: MTRR should be saved/restored
This fixes restoring a Linux VM if it was suspended while in the GRUB menu.
Adding MTTR increases the kernel dump size by 256 bytes per vCPU.
Sponsored by: vStack Reviewed by: markj, rew Differential Revision: https://reviews.freebsd.org/D43226
show more ...
|
Revision tags: release/14.0.0 |
|
#
f3ff0918 |
| 19-Oct-2023 |
Zhenlei Huang <zlei@FreeBSD.org> |
vmx: Prefer consistent naming for loader tunables
The following loader tunables do have corresponding sysctl MIBs but with different names. That may be historical reason. Let's prefer consistent nam
vmx: Prefer consistent naming for loader tunables
The following loader tunables do have corresponding sysctl MIBs but with different names. That may be historical reason. Let's prefer consistent naming for them so that it will be easier to read and maintain.
1. hw.vmm.l1d_flush -> hw.vmm.vmx.l1d_flush 2. hw.vmm.l1d_flush_sw -> hw.vmm.vmx.l1d_flush_sw 3. hw.vmm.vmx.use_apic_pir -> hw.vmm.vmx.cap.posted_interrupts 4. hw.vmm.vmx.use_apic_vid -> hw.vmm.vmx.cap.virtual_interrupt_delivery 5. hw.vmm.vmx.use_tpr_shadowing -> hw.vmm.vmx.cap.tpr_shadowing
Old names are kept for compatibility.
Meanwhile, add sysctl flag CTLFLAG_TUN to them so that `sysctl -T` will report them correctly.
Reviewed by: corvink, jhb, kib, #bhyve MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D42251
show more ...
|
#
685dc743 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
#
95ee2897 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
|
#
4d846d26 |
| 10-May-2023 |
Warner Losh <imp@FreeBSD.org> |
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of
spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
show more ...
|
#
c543e09f |
| 09-May-2023 |
Vitaliy Gusev <gusev.vitaliy@gmail.com> |
bhyve: save/restore pir_desc
Failing to preserve pir_desc can result in pending interrupts being lost on resume leading to a hung VM.
Reviewed by: corvink, jhb MFC after: 1 week Sponsored by: vS
bhyve: save/restore pir_desc
Failing to preserve pir_desc can result in pending interrupts being lost on resume leading to a hung VM.
Reviewed by: corvink, jhb MFC after: 1 week Sponsored by: vStack Differential Revision: https://reviews.freebsd.org/D35447
show more ...
|
#
fefac543 |
| 09-May-2023 |
Bojan Novković <bojan.novkovic@fer.hr> |
bhyve: fix vCPU single-stepping on VMX
This patch fixes virtual machine single stepping on VMX hosts.
Currently, when using bhyve's gdb stub, each attempt at single-stepping a vCPU lands in a timer
bhyve: fix vCPU single-stepping on VMX
This patch fixes virtual machine single stepping on VMX hosts.
Currently, when using bhyve's gdb stub, each attempt at single-stepping a vCPU lands in a timer interrupt. The current single-stepping mechanism uses the Monitor Trap Flag feature to cause VMEXIT after a single instruction is executed. Unfortunately, the SDM states that MTF causes VMEXITs for the next instruction that gets executed, which is often not what the person using the debugger expects. [1]
This patch adds a new VM capability that masks interrupts on a vCPU by blocking interrupt injection and modifies the gdb stub to use the newly added capability while single-stepping a vCPU.
[1] Intel SDM 26.5.2 Vol. 3C
Reviewed by: corvink, jbh MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D39949
show more ...
|
#
b10e100d |
| 05-May-2023 |
Corvin Köhne <corvink@FreeBSD.org> |
vmm: don't free unallocated memory
If vmx or svm is disabled in BIOS or the device isn't supported by vmm, modinit won't allocate these state save areas. As kmem_free panics when passing a NULL poin
vmm: don't free unallocated memory
If vmx or svm is disabled in BIOS or the device isn't supported by vmm, modinit won't allocate these state save areas. As kmem_free panics when passing a NULL pointer to it, loading the vmm kernel module causes a panic too.
PR: 271251 Reviewed by: markj Fixes: 74ac712f72cfd6d7b3db3c9d3b72ccf2824aa183 ("vmm: Dynamically allocate a couple of per-CPU state save areas") MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D39974
show more ...
|
#
74ac712f |
| 26-Apr-2023 |
Mark Johnston <markj@FreeBSD.org> |
vmm: Dynamically allocate a couple of per-CPU state save areas
This avoids bloating the BSS when MAXCPU is large.
No functional change intended.
PR: 269572 Reviewed by: corvink, rew Tested by: re
vmm: Dynamically allocate a couple of per-CPU state save areas
This avoids bloating the BSS when MAXCPU is large.
No functional change intended.
PR: 269572 Reviewed by: corvink, rew Tested by: rew MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39805
show more ...
|
#
0912408a |
| 26-Apr-2023 |
Vitaliy Gusev <gusev.vitaliy@gmail.com> |
vmm: fix HLT loop while vcpu has requested virtual interrupts
This fixes the detection of pending interrupts when pirval is 0 and the pending bit is set
More information how this situation occurs,
vmm: fix HLT loop while vcpu has requested virtual interrupts
This fixes the detection of pending interrupts when pirval is 0 and the pending bit is set
More information how this situation occurs, can be found here: https://github.com/freebsd/freebsd-src/blob/c5b5f2d8086f540fefe4826da013dd31d4e45fe8/sys/amd64/vmm/intel/vmx.c#L4016-L4031
Reviewed by: corvink, markj Fixes: 02cc877968bbcd57695035c67114a67427f54549 ("Recognize a pending virtual interrupt while emulating the halt instruction.") MFC after: 1 week Sponsored by: vStack Differential Revision: https://reviews.freebsd.org/D39620
show more ...
|
Revision tags: release/13.2.0 |
|
#
8104fc31 |
| 28-Feb-2023 |
Vitaliy Gusev <gusev.vitaliy@gmail.com> |
bhyve: fix restore of kernel structs
vmx_snapshot() and svm_snapshot() do not save any data and error occurs at resume:
Restoring kernel structs... vm_restore_kern_struct: Kernel struct size was 0
bhyve: fix restore of kernel structs
vmx_snapshot() and svm_snapshot() do not save any data and error occurs at resume:
Restoring kernel structs... vm_restore_kern_struct: Kernel struct size was 0 for: vmx Failed to restore kernel structs.
Reviewed by: corvink, markj Fixes: 39ec056e6dbd89e26ee21d2928dbd37335de0ebc ("vmm: Rework snapshotting of CPU-specific per-vCPU data.") MFC after: 2 weeks Sponsored by: vStack Differential Revision: https://reviews.freebsd.org/D38476
show more ...
|
Revision tags: release/12.4.0 |
|
#
892feec2 |
| 15-Nov-2022 |
Corvin Köhne <corvink@FreeBSD.org> |
vmm: avoid spurious rendezvous
A vcpu only checks if a rendezvous is in progress or not to decide if it should handle a rendezvous. This could lead to spurios rendezvous where a vcpu tries a handle
vmm: avoid spurious rendezvous
A vcpu only checks if a rendezvous is in progress or not to decide if it should handle a rendezvous. This could lead to spurios rendezvous where a vcpu tries a handle a rendezvous it isn't part of. This situation is properly handled by vm_handle_rendezvous but it could potentially degrade the performance. Avoid that by an early check if the vcpu is part of the rendezvous or not.
At the moment, rendezvous are only used to spin up application processors and to send ioapic interrupts. Spinning up application processors is done in the guest boot phase by sending INIT SIPI sequences to single vcpus. This is known to cause spurious rendezvous and only occurs in the boot phase. Sending ioapic interrupts is rare because modern guest will use msi and the rendezvous is always send to all vcpus.
Reviewed by: jhb MFC after: 1 week Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D37390
show more ...
|
#
2ee1a18d |
| 20-Nov-2022 |
Dmitry Chagin <dchagin@FreeBSD.org> |
vmm: Fix build w/o KDTRACE_HOOKS.
Reviewed by: imp Differential revision: https://reviews.freebsd.org/D37446
|
#
d487cba3 |
| 18-Nov-2022 |
Cy Schubert <cy@FreeBSD.org> |
vmm: Fix non-INVARIANTS build
Reported by: O. Hartmann <freebsd@walstatt-de.de> Reviewed by: jhb Fixes: 58eefc67a1cf Differential Revision: https://reviews.freebsd.org/D37444
|
#
49fd5115 |
| 18-Nov-2022 |
John Baldwin <jhb@FreeBSD.org> |
vmm: Trim some pointless #ifdef KTR.
Reported by: markj Reviewed by: corvink, markj Differential Revision: https://reviews.freebsd.org/D37272
|
#
ee98f99d |
| 18-Nov-2022 |
John Baldwin <jhb@FreeBSD.org> |
vmm: Convert VM_MAXCPU into a loader tunable hw.vmm.maxcpu.
The default is now the number of physical CPUs in the system rather than 16.
Reviewed by: corvink, markj Differential Revision: https://r
vmm: Convert VM_MAXCPU into a loader tunable hw.vmm.maxcpu.
The default is now the number of physical CPUs in the system rather than 16.
Reviewed by: corvink, markj Differential Revision: https://reviews.freebsd.org/D37175
show more ...
|
#
58eefc67 |
| 18-Nov-2022 |
John Baldwin <jhb@FreeBSD.org> |
vmm vmx: Allocate vpids on demand as each vCPU is initialized.
Compared to the previous version this does mean that if the system as a whole runs out of dedicated vPIDs you might end up with some vC
vmm vmx: Allocate vpids on demand as each vCPU is initialized.
Compared to the previous version this does mean that if the system as a whole runs out of dedicated vPIDs you might end up with some vCPUs within a single VM using dedicated vPIDs and others using shared vPIDs, but this should not break anything.
Reviewed by: corvink, markj Differential Revision: https://reviews.freebsd.org/D37169
show more ...
|
#
80cb5d84 |
| 18-Nov-2022 |
John Baldwin <jhb@FreeBSD.org> |
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
|
#
d3956e46 |
| 18-Nov-2022 |
John Baldwin <jhb@FreeBSD.org> |
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 u
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
show more ...
|
#
3dc3d32a |
| 18-Nov-2022 |
John Baldwin <jhb@FreeBSD.org> |
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
|
#
950af9ff |
| 18-Nov-2022 |
John Baldwin <jhb@FreeBSD.org> |
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 str
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
show more ...
|