#
d665d229 |
| 23-Jul-2014 |
Neel Natu <neel@FreeBSD.org> |
Emulate instructions emitted by OpenBSD/i386 version 5.5: - CMP REG, r/m - MOV AX/EAX/RAX, moffset - MOV moffset, AX/EAX/RAX - PUSH r/m
|
#
091d4532 |
| 19-Jul-2014 |
Neel Natu <neel@FreeBSD.org> |
Handle nested exceptions in bhyve.
A nested exception condition arises when a second exception is triggered while delivering the first exception. Most nested exceptions can be handled serially but s
Handle nested exceptions in bhyve.
A nested exception condition arises when a second exception is triggered while delivering the first exception. Most nested exceptions can be handled serially but some are converted into a double fault. If an exception is generated during delivery of a double fault then the virtual machine shuts down as a result of a triple fault.
vm_exit_intinfo() is used to record that a VM-exit happened while an event was being delivered through the IDT. If an exception is triggered while handling the VM-exit it will be treated like a nested exception.
vm_entry_intinfo() is used by processor-specific code to get the event to be injected into the guest on the next VM-entry. This function is responsible for deciding the disposition of nested exceptions.
show more ...
|
#
f7a9f178 |
| 15-Jul-2014 |
Neel Natu <neel@FreeBSD.org> |
Add support for operand size and address size override prefixes in bhyve's instruction emulation [1].
Fix bug in emulation of opcode 0x8A where the destination is a legacy high byte register and the
Add support for operand size and address size override prefixes in bhyve's instruction emulation [1].
Fix bug in emulation of opcode 0x8A where the destination is a legacy high byte register and the guest vcpu is in 32-bit mode. Prior to this change instead of modifying %ah, %bh, %ch or %dh the emulation would end up modifying %spl, %bpl, %sil or %dil instead.
Add support for moffsets by treating it as a 2, 4 or 8 byte immediate value during instruction decoding.
Fix bug in verify_gla() where the linear address computed after decoding the instruction was not being truncated to the effective address size [2].
Tested by: Leon Dang [1] Reported by: Peter Grehan [2] Sponsored by: Nahanni Systems
show more ...
|
Revision tags: release/9.3.0 |
|
#
af3b2549 |
| 28-Jun-2014 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Pull in r267961 and r267973 again. Fix for issues reported will follow.
|
#
37a107a4 |
| 28-Jun-2014 |
Glen Barber <gjb@FreeBSD.org> |
Revert r267961, r267973:
These changes prevent sysctl(8) from returning proper output, such as:
1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1
Revert r267961, r267973:
These changes prevent sysctl(8) from returning proper output, such as:
1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory
show more ...
|
#
3da1cf1e |
| 27-Jun-2014 |
Hans Petter Selasky <hselasky@FreeBSD.org> |
Extend the meaning of the CTLFLAG_TUN flag to automatically check if there is an environment variable which shall initialize the SYSCTL during early boot. This works for all SYSCTL types both statica
Extend the meaning of the CTLFLAG_TUN flag to automatically check if there is an environment variable which shall initialize the SYSCTL during early boot. This works for all SYSCTL types both statically and dynamically created ones, except for the SYSCTL NODE type and SYSCTLs which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to be used in the case a tunable sysctl has a custom initialisation function allowing the sysctl to still be marked as a tunable. The kernel SYSCTL API is mostly the same, with a few exceptions for some special operations like iterating childrens of a static/extern SYSCTL node. This operation should probably be made into a factored out common macro, hence some device drivers use this. The reason for changing the SYSCTL API was the need for a SYSCTL parent OID pointer and not only the SYSCTL parent OID list pointer in order to quickly generate the sysctl path. The motivation behind this patch is to avoid parameter loading cludges inside the OFED driver subsystem. Instead of adding special code to the OFED driver subsystem to post-load tunables into dynamically created sysctls, we generalize this in the kernel.
Other changes: - Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask" to "hw.pcic.intr_mask". - Removed redundant TUNABLE statements throughout the kernel. - Some minor code rewrites in connection to removing not needed TUNABLE statements. - Added a missing SYSCTL_DECL(). - Wrapped two very long lines. - Avoid malloc()/free() inside sysctl string handling, in case it is called to initialize a sysctl from a tunable, hence malloc()/free() is not ready when sysctls from the sysctl dataset are registered. - Bumped FreeBSD version to indicate SYSCTL API change.
MFC after: 2 weeks Sponsored by: Mellanox Technologies
show more ...
|
#
cf1d80d8 |
| 26-Jun-2014 |
Peter Grehan <grehan@FreeBSD.org> |
Expose the amount of resident and wired memory from the guest's vmspace.
This is different than the amount shown for the process e.g. by /usr/bin/top - that is the mappings faulted in by the mmap'd
Expose the amount of resident and wired memory from the guest's vmspace.
This is different than the amount shown for the process e.g. by /usr/bin/top - that is the mappings faulted in by the mmap'd region of guest memory.
The values can be fetched with bhyvectl
# bhyvectl --get-stats --vm=myvm ... Resident memory 413749248 Wired memory 0 ...
vmm_stat.[ch] - Modify the counter code in bhyve to allow direct setting of a counter as opposed to incrementing, and providing a callback to fetch a counter's value.
Reviewed by: neel
show more ...
|
#
40487465 |
| 10-Jun-2014 |
Neel Natu <neel@FreeBSD.org> |
Add helper functions to populate VM exit information for rendezvous and astpending exits. This is to reduce code duplication between VT-x and SVM implementations.
|
#
5fcf252f |
| 07-Jun-2014 |
Neel Natu <neel@FreeBSD.org> |
Add ioctl(VM_REINIT) to reinitialize the virtual machine state maintained by vmm.ko. This allows the virtual machine to be restarted without having to destroy it first.
Reviewed by: grehan
|
#
6cec9cad |
| 03-Jun-2014 |
Peter Grehan <grehan@FreeBSD.org> |
MFC @ r266724
An SVM update will follow this.
|
#
95ebc360 |
| 01-Jun-2014 |
Neel Natu <neel@FreeBSD.org> |
Activate vcpus from bhyve(8) using the ioctl VM_ACTIVATE_CPU instead of doing it implicitly in vmm.ko.
Add ioctl VM_GET_CPUS to get the current set of 'active' and 'suspended' cpus and display them
Activate vcpus from bhyve(8) using the ioctl VM_ACTIVATE_CPU instead of doing it implicitly in vmm.ko.
Add ioctl VM_GET_CPUS to get the current set of 'active' and 'suspended' cpus and display them via /usr/sbin/bhyvectl using the "--get-active-cpus" and "--get-suspended-cpus" options.
This is in preparation for being able to reset virtual machine state without having to destroy and recreate it.
show more ...
|
#
e813a873 |
| 24-May-2014 |
Neel Natu <neel@FreeBSD.org> |
Consolidate all the information needed by the guest page table walker into 'struct vm_guest_paging'.
Check for canonical addressing in vmm_gla2gpa() and inject a protection fault into the guest if a
Consolidate all the information needed by the guest page table walker into 'struct vm_guest_paging'.
Check for canonical addressing in vmm_gla2gpa() and inject a protection fault into the guest if a violation is detected.
If the page table walk is restarted in vmm_gla2gpa() then reset 'ptpphys' to point to the root of the page tables.
show more ...
|
#
37a723a5 |
| 24-May-2014 |
Neel Natu <neel@FreeBSD.org> |
When injecting a page fault into the guest also update the guest's %cr2 to indicate the faulting linear address.
If the guest PML4 entry has the PG_PS bit set then inject a page fault into the guest
When injecting a page fault into the guest also update the guest's %cr2 to indicate the faulting linear address.
If the guest PML4 entry has the PG_PS bit set then inject a page fault into the guest with the PGEX_RSV bit set in the error_code.
Get rid of redundant checks for the PG_RW violations when walking the page tables.
show more ...
|
#
d17b5104 |
| 23-May-2014 |
Neel Natu <neel@FreeBSD.org> |
Add emulation of the "outsb" instruction. NetBSD guests use this to write to the UART FIFO.
The emulation is constrained in a number of ways: 64-bit only, doesn't check for all exception conditions,
Add emulation of the "outsb" instruction. NetBSD guests use this to write to the UART FIFO.
The emulation is constrained in a number of ways: 64-bit only, doesn't check for all exception conditions, limited to i/o ports emulated in userspace.
Some of these constraints will be relaxed in followup commits.
Requested by: grehan Reviewed by: tychon (partially and a much earlier version)
show more ...
|
#
fd949af6 |
| 22-May-2014 |
Neel Natu <neel@FreeBSD.org> |
Inject page fault into the guest if the page table walker detects an invalid translation for the guest linear address.
|
#
414fdaf0 |
| 21-May-2014 |
Alan Somers <asomers@FreeBSD.org> |
IFC @266473
|
#
e4c8a13d |
| 19-May-2014 |
Neel Natu <neel@FreeBSD.org> |
Add PG_U (user/supervisor) checks when translating a guest linear address to a guest physical address.
PG_PS (page size) field is valid only in a PDE or a PDPTE so it is now checked only in non-term
Add PG_U (user/supervisor) checks when translating a guest linear address to a guest physical address.
PG_PS (page size) field is valid only in a PDE or a PDPTE so it is now checked only in non-terminal paging entries.
Ignore the upper 32-bits of the CR3 for PAE paging.
show more ...
|
#
cc3f4b99 |
| 09-May-2014 |
Simon J. Gerraty <sjg@FreeBSD.org> |
Merge from head
|
#
055fc2cb |
| 05-May-2014 |
Neel Natu <neel@FreeBSD.org> |
Virtual machine halt detection is turned on by default. Allow it to be disabled via the tunable 'hw.vmm.halt_detection'.
|
#
e50ce2aa |
| 02-May-2014 |
Neel Natu <neel@FreeBSD.org> |
Add logic in the HLT exit handler to detect if the guest has put all vcpus to sleep permanently by executing a HLT with interrupts disabled.
When this condition is detected the guest with be suspend
Add logic in the HLT exit handler to detect if the guest has put all vcpus to sleep permanently by executing a HLT with interrupts disabled.
When this condition is detected the guest with be suspended with a reason of VM_SUSPEND_HALT and the bhyve(8) process will exit.
Tested by executing "halt" inside a RHEL7-beta guest.
Discussed with: grehan@ Reviewed by: jhb@, tychon@
show more ...
|
#
c6a0cc2e |
| 29-Apr-2014 |
Neel Natu <neel@FreeBSD.org> |
Some Linux guests will implement a 'halt' by disabling the APIC and executing the 'HLT' instruction. This condition was detected by 'vm_handle_hlt()' and converted into the SPINDOWN_CPU exitcode . Th
Some Linux guests will implement a 'halt' by disabling the APIC and executing the 'HLT' instruction. This condition was detected by 'vm_handle_hlt()' and converted into the SPINDOWN_CPU exitcode . The bhyve(8) process would exit the vcpu thread in response to a SPINDOWN_CPU and when the last vcpu was spun down it would reset the virtual machine via vm_suspend(VM_SUSPEND_RESET).
This functionality was broken in r263780 in a way that made it impossible to kill the bhyve(8) process because it would loop forever in vm_handle_suspend().
Unbreak this by removing the code to spindown vcpus. Thus a 'halt' from a Linux guest will appear to be hung but this is consistent with the behavior on bare metal. The guest can be rebooted by using the bhyvectl options '--force-reset' or '--force-poweroff'.
Reviewed by: grehan@
show more ...
|
#
f0fdcfe2 |
| 29-Apr-2014 |
Neel Natu <neel@FreeBSD.org> |
Allow a virtual machine to be forcibly reset or powered off. This is done by adding an argument to the VM_SUSPEND ioctl that specifies how the virtual machine should be suspended, viz. VM_SUSPEND_RES
Allow a virtual machine to be forcibly reset or powered off. This is done by adding an argument to the VM_SUSPEND ioctl that specifies how the virtual machine should be suspended, viz. VM_SUSPEND_RESET or VM_SUSPEND_POWEROFF.
The disposition of VM_SUSPEND is also made available to the exit handler via the 'u.suspended' member of 'struct vm_exit'.
This capability is exposed via the '--force-reset' and '--force-poweroff' arguments to /usr/sbin/bhyvectl.
Discussed with: grehan@
show more ...
|
#
3b8f0845 |
| 28-Apr-2014 |
Simon J. Gerraty <sjg@FreeBSD.org> |
Merge head
|
#
84e51a1b |
| 23-Apr-2014 |
Alan Somers <asomers@FreeBSD.org> |
IFC @264767
|
#
380174cb |
| 15-Apr-2014 |
John Baldwin <jhb@FreeBSD.org> |
Don't spindown the BSP if it executes hlt with the APIC disabled. A guest that doesn't use the APIC at all can trigger this, plus the BSP always needs to execute as it should trigger a reset, etc.
Don't spindown the BSP if it executes hlt with the APIC disabled. A guest that doesn't use the APIC at all can trigger this, plus the BSP always needs to execute as it should trigger a reset, etc.
Reviewed by: tychon
show more ...
|