aboutsummaryrefslogtreecommitdiff
path: root/lib/libvmmapi
Commit message (Collapse)AuthorAgeFilesLines
...
* Forgotten to remove the previous if statement in commit r355838.Marcelo Araujo2019-12-171-4/+2
| | | | | | | | MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D19400 Notes: svn path=/head/; revision=355839
* Attempt to load vmm(4) module before creating a guest using vm_create()Marcelo Araujo2019-12-171-1/+7
| | | | | | | | | | | | wrapper in libvmmapi. Submitted by: Rob Fairbanks <rob.fx907_gmail.com> Reviewed by: jhb MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D19400 Notes: svn path=/head/; revision=355838
* Update Makefile.depend filesSimon J. Gerraty2019-12-111-1/+0
| | | | | | | | | | | | | Update a bunch of Makefile.depend files as a result of adding Makefile.depend.options files Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22494 Notes: svn path=/head/; revision=355617
* bhyve: Use MAP_GUARD when mapping guest memory ranges.John Baldwin2018-09-061-5/+4
| | | | | | | | | | | | | | | | Instead of relying on PROT_NONE mappings with MAP_ANON, use MAP_GUARD to reserve address space around guest memory ranges including the guard ranges of address space around mappings. Submitted by: Shawn Webb Reviewed by: araujo Approved by: re (rgrimes) MFC after: 1 month Sponsored by: HardendBSD and G2, Inc Differential Revision: https://reviews.freebsd.org/D16822 Notes: svn path=/head/; revision=338511
* Fix style(9) space vs tab.Marcelo Araujo2018-06-141-7/+6
| | | | | | | | | | Reviewed by: jhb MFC after: 3 weeks. Sponsored by: iXsystems Inc. Differential Revision: https://reviews.freebsd.org/D15774 Notes: svn path=/head/; revision=335103
* Add the ability to control the CPU topology of created VMsRodney W. Grimes2018-04-082-1/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from userland without the need to use sysctls, it allows the old sysctls to continue to function, but deprecates them at FreeBSD_version 1200060 (Relnotes for deprecate). The command line of bhyve is maintained in a backwards compatible way. The API of libvmmapi is maintained in a backwards compatible way. The sysctl's are maintained in a backwards compatible way. Added command option looks like: bhyve -c [[cpus=]n][,sockets=n][,cores=n][,threads=n][,maxcpus=n] The optional parts can be specified in any order, but only a single integer invokes the backwards compatible parse. [,maxcpus=n] is hidden by #ifdef until kernel support is added, though the api is put in place. bhyvectl --get-cpu-topology option added. Reviewed by: grehan (maintainer, earlier version), Reviewed by: bcr (manpages) Approved by: bde (mentor), phk (mentor) Tested by: Oleg Ginzburg <olevole@olevole.ru> (cbsd) MFC after: 1 week Relnotes: Y Differential Revision: https://reviews.freebsd.org/D9930 Notes: svn path=/head/; revision=332298
* Add a way to temporarily suspend and resume virtual CPUs.John Baldwin2018-04-062-1/+36
| | | | | | | | | | | | | | | | | | | | | | | | | This is used as part of implementing run control in bhyve's debug server. The hypervisor now maintains a set of "debugged" CPUs. Attempting to run a debugged CPU will fail to execute any guest instructions and will instead report a VM_EXITCODE_DEBUG exit to the userland hypervisor. Virtual CPUs are placed into the debugged state via vm_suspend_cpu() (implemented via a new VM_SUSPEND_CPU ioctl). Virtual CPUs can be resumed via vm_resume_cpu() (VM_RESUME_CPU ioctl). The debug server suspends virtual CPUs when it wishes them to stop executing in the guest (for example, when a debugger attaches to the server). The debug server can choose to resume only a subset of CPUs (for example, when single stepping) or it can choose to resume all CPUs. The debug server must explicitly mark a CPU as resumed via vm_resume_cpu() before the virtual CPU will successfully execute any guest instructions. Reviewed by: avg, grehan Tested on: Intel (jhb), AMD (avg) Differential Revision: https://reviews.freebsd.org/D14466 Notes: svn path=/head/; revision=332157
* Add a new variant of the GLA2GPA ioctl for use by the debug server.John Baldwin2018-02-262-0/+25
| | | | | | | | | | | | | | | | Unlike the existing GLA2GPA ioctl, GLA2GPA_NOFAULT does not modify the guest. In particular, it does not inject any faults or modify PTEs in the guest when performing an address space translation. This is used by bhyve's debug server to read and write memory for the remote debugger. Reviewed by: grehan MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D14075 Notes: svn path=/head/; revision=330032
* Add two new ioctls to bhyve for batch register fetch/store operations.John Baldwin2018-02-222-0/+39
| | | | | | | | | | | | | These are a convenience for bhyve's debug server to use a single ioctl for 'g' and 'G' rather than a loop of individual get/set ioctl requests. Reviewed by: grehan MFC after: 2 months Differential Revision: https://reviews.freebsd.org/D14074 Notes: svn path=/head/; revision=329768
* lib: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-263-0/+6
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326219
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Capsicum support for bhyve(8).Bartek Rutkowski2017-02-142-1/+46
| | | | | | | | | | | | | Adds Capsicum sandboxing to bhyve. Submitted by: Pawel Biernacki <pawel.biernacki@gmail.com> Reviewed by: grehan, oshogbo Approved by: emaste, grehan Sponsored by: Mysterious Code Ltd. Differential Revision: https://reviews.freebsd.org/D8290 Notes: svn path=/head/; revision=313727
* Fix possible integer overflow in guest memory bounds checking, which couldGleb Smirnoff2016-12-061-3/+8
| | | | | | | | | | | lead to access from the virtual machine to the heap of the bhyve(8) process. Submitted by: Felix Wilhelm <fwilhelm ernw.de> Patch by: grehan Security: FreeBSD-SA-16:38.bhyve Notes: svn path=/head/; revision=309640
* lib: minor spelling fixes in comments.Pedro F. Giffuni2016-05-011-1/+1
| | | | | | | No functional change. Notes: svn path=/head/; revision=298896
* MFHGlen Barber2016-02-221-1/+0
|\ | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295886
| * As <machine/param.h> is included from <sys/param.h>, there is no needSvatopluk Kraus2016-02-221-1/+0
| | | | | | | | | | | | | | | | | | | | to include it explicitly when <sys/param.h> is already included. Reviewed by: alc, kib Differential Revision: https://reviews.freebsd.org/D5378 Notes: svn path=/head/; revision=295881
* | First pass through library packaging.Glen Barber2016-02-041-0/+1
|/ | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295278
* META MODE: Prefer INSTALL=tools/install.sh to lessen the need for xinstall.host.Bryan Drewery2015-11-251-1/+0
| | | | | | | | | | | This both avoids some dependencies on xinstall.host and allows bootstrapping on older releases to work due to lack of at least 'install -l' support. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=291307
* Move the 'devmem' device nodes from /dev/vmm to /dev/vmm.ioNeel Natu2015-07-061-1/+1
| | | | | | | | | | | Some external tools just do a 'ls /dev/vmm' to figure out the bhyve virtual machines on the host. These tools break if the devmem device nodes also appear in /dev/vmm. Requested by: grehan Notes: svn path=/head/; revision=285218
* Updated dependsSimon J. Gerraty2015-07-031-2/+0
| | | | Notes: svn path=/head/; revision=285081
* Fix a regression in "movs" emulation after r284539. The regression was causedNeel Natu2015-06-221-8/+17
| | | | | | | | | | | | | | | | | | | | | | due to a change in behavior of the 'vm_map_gpa()'. Prior to r284539 if 'vm_map_gpa()' was called to map an address range in the guest MMIO region then it would return NULL. This was used by the "movs" emulation to detect if the 'src' or 'dst' operand was in MMIO space. Post r284539 'vm_map_gpa()' started returning a non-NULL pointer even when mapping the guest MMIO region. Fix this by returning non-NULL only if [gaddr, gaddr+len) is entirely within the 'lowmem' or 'highmem' regions and NULL otherwise. Pointy hat to: neel Reviewed by: grehan Reported by: tychon, Ben Perrault (ben.perrault@gmail.com) MFC after: 1 week Notes: svn path=/head/; revision=284688
* Restructure memory allocation in bhyve to support "devmem".Neel Natu2015-06-182-61/+311
| | | | | | | | | | | | | | | | | | | | | | | | devmem is used to represent MMIO devices like the boot ROM or a VESA framebuffer where doing a trap-and-emulate for every access is impractical. devmem is a hybrid of system memory (sysmem) and emulated device models. devmem is mapped in the guest address space via nested page tables similar to sysmem. However the address range where devmem is mapped may be changed by the guest at runtime (e.g. by reprogramming a PCI BAR). Also devmem is usually mapped RO or RW as compared to RWX mappings for sysmem. Each devmem segment is named (e.g. "bootrom") and this name is used to create a device node for the devmem segment (e.g. /dev/vmm/testvm.bootrom). The device node supports mmap(2) and this decouples the host mapping of devmem from its mapping in the guest address space (which can change). Reviewed by: tychon Discussed with: grehan Differential Revision: https://reviews.freebsd.org/D2762 MFC after: 4 weeks Notes: svn path=/head/; revision=284539
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+22
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * Merge sync of headSimon J. Gerraty2015-05-273-45/+120
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Merge head from 7/28Simon J. Gerraty2014-08-192-4/+272
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=270164
| * | Updated dependenciesSimon J. Gerraty2014-05-161-1/+1
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * | Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * | Merge from headSimon J. Gerraty2014-05-082-3/+6
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265720
| * \ \ Merge headSimon J. Gerraty2014-04-281-2/+164
| |\ \ \ | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265044
| * | | | Merge headSimon J. Gerraty2014-04-272-30/+161
| |\| | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265006
| * | | | New/updated dependenciesSimon J. Gerraty2013-10-171-0/+19
| | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=256698
* | | | | Deprecate the 3-way return values from vm_gla2gpa() and vm_copy_setup().Neel Natu2015-05-062-26/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this change both functions returned 0 for success, -1 for failure and +1 to indicate that an exception was injected into the guest. The numerical value of ERESTART also happens to be -1 so when these functions returned -1 it had to be translated to a positive errno value to prevent the VM_RUN ioctl from being inadvertently restarted. This made it easy to introduce bugs when writing emulation code. Fix this by adding an 'int *guest_fault' parameter and setting it to '1' if an exception was delivered to the guest. The return value is 0 or EFAULT so no additional translation is needed. Reviewed by: tychon MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D2428 Notes: svn path=/head/; revision=282558
* | | | | Fix overlinking in bhyve:Baptiste Daroussin2015-04-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libvmmapi is actually needed to be linked to libutil, not bhyve nor bhyveload Notes: svn path=/head/; revision=281338
* | | | | Fix "MOVS" instruction memory to MMIO emulation. Currently updates toTycho Nightingale2015-04-012-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | %rdi, %rsi, etc are inadvertently bypassed along with the check to see if the instruction needs to be repeated per the 'rep' prefix. Add "MOVS" instruction support for the 'MMIO to MMIO' case. Reviewed by: neel Notes: svn path=/head/; revision=280929
* | | | | Fix a bug in libvmmapi 'vm_copy_setup()' where it would return success even ifNeel Natu2015-01-192-7/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the 'gpa' was in the guest MMIO region. This would manifest as a segmentation fault in 'vm_map_copyin()' or 'vm_map_copyout()' because 'vm_map_gpa()' would return NULL for this 'gpa'. Fix this by calling 'vm_map_gpa()' in 'vm_copy_setup' and returning a failure if the 'gpa' cannot be mapped. This matches the behavior of 'vm_copy_setup()' in vmm.ko. MFC after: 1 week Notes: svn path=/head/; revision=277359
* | | | | Simplify instruction restart logic in bhyve.Neel Natu2015-01-182-26/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Keep track of the next instruction to be executed by the vcpu as 'nextrip'. As a result the VM_RUN ioctl no longer takes the %rip where a vcpu should start execution. Also, instruction restart happens implicitly via 'vm_inject_exception()' or explicitly via 'vm_restart_instruction()'. The APIs behave identically in both kernel and userspace contexts. The main beneficiary is the instruction emulation code that executes in both contexts. bhyve(8) VM exit handlers now treat 'vmexit->rip' and 'vmexit->inst_length' as readonly: - Restarting an instruction is now done by calling 'vm_restart_instruction()' as opposed to setting 'vmexit->inst_length' to 0 (e.g. emulate_inout()) - Resuming vcpu at an arbitrary %rip is now done by setting VM_REG_GUEST_RIP as opposed to changing 'vmexit->rip' (e.g. vmexit_task_switch()) Differential Revision: https://reviews.freebsd.org/D1526 Reviewed by: grehan MFC after: 2 weeks Notes: svn path=/head/; revision=277310
* | | | | Replace bhyve's minimal RTC emulation with a fully featured one in vmm.ko.Neel Natu2014-12-302-0/+58
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new RTC emulation supports all interrupt modes: periodic, update ended and alarm. It is also capable of maintaining the date/time and NVRAM contents across virtual machine reset. Also, the date/time fields can now be modified by the guest. Since bhyve now emulates both the PIT and the RTC there is no need for "Legacy Replacement Routing" in the HPET so get rid of it. The RTC device state can be inspected via bhyvectl as follows: bhyvectl --vm=vm --get-rtc-time bhyvectl --vm=vm --set-rtc-time=<unix_time_secs> bhyvectl --vm=vm --rtc-nvram-offset=<offset> --get-rtc-nvram bhyvectl --vm=vm --rtc-nvram-offset=<offset> --set-rtc-nvram=<value> Reviewed by: tychon Discussed with: grehan Differential Revision: https://reviews.freebsd.org/D1385 MFC after: 2 weeks Notes: svn path=/head/; revision=276428
* | | | Fix fault injection in bhyve.Neel Natu2014-07-242-32/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The faulting instruction needs to be restarted when the exception handler is done handling the fault. bhyve now does this correctly by setting 'vmexit[vcpu].inst_length' to zero so the %rip is not advanced. A minor complication is that the fault injection APIs are used by instruction emulation code that is shared by vmm.ko and bhyve. Thus the argument that refers to 'struct vm *' in kernel or 'struct vmctx *' in userspace needs to be loosely typed as a 'void *'. Notes: svn path=/head/; revision=269042
* | | | Emulate instructions emitted by OpenBSD/i386 version 5.5:Neel Natu2014-07-232-2/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - CMP REG, r/m - MOV AX/EAX/RAX, moffset - MOV moffset, AX/EAX/RAX - PUSH r/m Notes: svn path=/head/; revision=269008
* | | | Handle nested exceptions in bhyve.Neel Natu2014-07-192-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=268889
* | | | Provide APIs to directly get 'lowmem' and 'highmem' size directly.Neel Natu2014-06-242-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the sizes were inferred indirectly based on the size of the mappings at 0 and 4GB respectively. This works fine as long as size of the allocation is identical to the size of the mapping in the guest's address space. However, if the mapping is disjoint then this assumption falls apart (e.g., due to the legacy BIOS hole between 640KB and 1MB). Notes: svn path=/head/; revision=267811
* | | | Add ioctl(VM_REINIT) to reinitialize the virtual machine state maintainedNeel Natu2014-06-072-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | by vmm.ko. This allows the virtual machine to be restarted without having to destroy it first. Reviewed by: grehan Notes: svn path=/head/; revision=267216
* | | | Activate vcpus from bhyve(8) using the ioctl VM_ACTIVATE_CPU instead of doingNeel Natu2014-05-312-1/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=266933
* | | | Fix issue with restarting an "insb/insw/insl" instruction because of a pageNeel Natu2014-05-262-32/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fault on the destination buffer. Prior to this change a page fault would be detected in vm_copyout(). This was done after the I/O port access was done. If the I/O port access had side-effects (e.g. reading the uart FIFO) then restarting the instruction would result in incorrect behavior. Fix this by validating the guest linear address before doing the I/O port emulation. If the validation results in a page fault exception being injected into the guest then the instruction can now be restarted without any side-effects. Notes: svn path=/head/; revision=266708
* | | | Add libvmmapi functions vm_copyin() and vm_copyout() to copy into and outNeel Natu2014-05-242-0/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of the guest linear address space. These APIs in turn use a new ioctl 'VM_GLA2GPA' to convert the guest linear address to guest physical. Use the new copyin/copyout APIs when emulating ins/outs instruction in bhyve(8). Notes: svn path=/head/; revision=266633
* | | | Implement a PCI interrupt router to route PCI legacy INTx interrupts toJohn Baldwin2014-05-152-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the legacy 8259A PICs. - Implement an ICH-comptabile PCI interrupt router on the lpc device with 8 steerable pins configured via config space access to byte-wide registers at 0x60-63 and 0x68-6b. - For each configured PCI INTx interrupt, route it to both an I/O APIC pin and a PCI interrupt router pin. When a PCI INTx interrupt is asserted, ensure that both pins are asserted. - Provide an initial routing of PCI interrupt router (PIRQ) pins to 8259A pins (ISA IRQs) and initialize the interrupt line config register for the corresponding PCI function with the ISA IRQ as this matches existing hardware. - Add a global _PIC method for OSPM to select the desired interrupt routing configuration. - Update the _PRT methods for PCI bridges to provide both APIC and legacy PRT tables and return the appropriate table based on the configured routing configuration. Note that if the lpc device is not configured, no routing information is provided. - When the lpc device is enabled, provide ACPI PCI link devices corresponding to each PIRQ pin. - Add a VMM ioctl to adjust the trigger mode (edge vs level) for 8259A pins via the ELCR. - Mark the power management SCI as level triggered. - Don't hardcode the number of elements in Packages in the source for the DSDT. iasl(8) will fill in the actual number of elements, and this makes it simpler to generate a Package with a variable number of elements. Reviewed by: tycho Notes: svn path=/head/; revision=266125
* | | | Don't include the guest memory segments in the bhyve(8) process core dump.Neel Natu2014-05-132-3/+18
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This has not added a lot of value when debugging bhyve issues while greatly increasing the time and space required to store the core file. Passing the "-C" option to bhyve(8) will change the default and dump guest memory in the core dump. Requested by: grehan Reviewed by: grehan Notes: svn path=/head/; revision=265951
* | | Allow a virtual machine to be forcibly reset or powered off. This is doneNeel Natu2014-04-282-3/+6
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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@ Notes: svn path=/head/; revision=265062
* | Add support for emulating the slave PIC.Tycho Nightingale2014-04-141-1/+1
| | | | | | | | | | | | | | | | Reviewed by: grehan, jhb Approved by: grehan (co-mentor) Notes: svn path=/head/; revision=264468
* | Add an ioctl to suspend a virtual machine (VM_SUSPEND). The ioctl can be calledNeel Natu2014-03-262-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from any context i.e., it is not required to be called from a vcpu thread. The ioctl simply sets a state variable 'vm->suspend' to '1' and returns. The vcpus inspect 'vm->suspend' in the run loop and if it is set to '1' the vcpu breaks out of the loop with a reason of 'VM_EXITCODE_SUSPENDED'. The suspend handler waits until all 'vm->active_cpus' have transitioned to 'vm->suspended_cpus' before returning to userspace. Discussed with: grehan Notes: svn path=/head/; revision=263780