| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of a round about way of sending a message to vmm that 'send is
successful' and terminating by vm_remove from vmm, we can send the imsg and
exit in the vm process. The sigchld handler in vmm will vm_remove it from its
structures. This is how a normal vm is terminated as well.
Previously, vm_remove was called in vmm_dispatch_vm (ie. the event handler to
receive messages from vm process) when hanlding the IMSG_VMDOP_SEND_VM_RESPONSE
(ie. the vm process has written the vm state to the fd passed on by vmctl
send). This is not how vm_remove was intented to be used as it does a
free(vm). The vm struct holds the buffers for imsg and so after handling this
IMSG_VMDOP_SEND_VM_RESPONSE message, vmm_dispatch_vm loops again to do
imsg_get(ibuf, &imsg) to read the next message (and we had just freed this
*ibuf when we freed the vm struct) causing it to segfault.
reported by kn@
ok kn@
|
|
|
|
|
|
|
|
| |
Previous implementation hit a deadlock sometimes as the pthread_cond_broadcast
for the pause mutex could happen before pthread_cond_wait. This implementation
uses a barrier which is hit when all vpcus are paused.
ok mpi@
|
|
|
|
|
|
|
|
|
|
|
|
| |
This exposes VMM_IOC_MPROTECT_EPT which can be used by vmd to lock in physical
pages. Currently, vmd just terminates the vm in case it gets a protection fault
in the future.
This feature is used by solo5 which uses vmm(4) as a backend hypervisor.
ok mpi@
Patch from Adam Steen <adam@adamsteen.com.au>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Removes an XXX which slept for 1s waiting for the vcpu thread to reach HLT and
pause. We now define a paused and unpaused condition so that a call to
pause_vm() / vmctl pause blocks till the vm really reaches a paused state.
Also, detach events for devices from event loop when pausing and add them back
when unpausing. This is because some callbacks call pthread_mutex_lock and if
the vm is paused, it would block also causing the libevent thread to block.
This would mean that we would not be able to process any IMSGs received from vmm
(parent process) including a message to unpause.
ok mlarkin@
|
|
|
|
|
|
| |
we ended up accidentally breaking vmctl. This will need more thought.
ok ori@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After debugging with ori@, it looks like an event ends up on the wrong
libevent queue, and we end continually de-queueing and re-queueing the
event continually. While it's unclear exactly why this happened, a clue
on libevent's github issues page for the same problem pointed us to using
a different event base for the device events. This seems to have unstuck
ori@'s problematic VM, and I have also seen no more hangs after this.
We have not completely separated the queues; ori@ will work on setting
new libevent bases for those later. But those events are pretty
frequency.
with help from and ok ori@
|
|
|
|
|
|
|
| |
Implement VMM_IOC_READVMPARAMS and VMM_IOC_WRITEVMPARAMS ioctls to read and
write pvclock state.
reads ok mlarkin@
|
|
|
|
|
|
| |
value < 0. errno is only updated in this case. Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.
|
|
|
|
|
|
|
| |
These never got unset on AMD/SVM guests when booted via vmctl start
-b causing them to run very slow
ok mlarkin@
|
|
|
|
|
|
|
|
|
|
| |
Add a first cut of x86 page table walker to vmd(8) and vmm(4). This function is
not used right now but is a building block for future features like HPET, OUTSB
and INSB emulation, nested virtualisation support, etc.
With help from Mike Larkin
ok mlarkin@
|
|
|
|
|
|
| |
set it to VMM_HV_SIGNATURE and check for it upon restoring a vm image
ok mlarkin@ pd@
|
|
|
|
|
|
|
|
|
| |
a handful of separate variables. this will makes it easier for vmd to report
and check on the individual vm states
no functional change intended
ok ccardenas@ mlarkin@
|
|
|
|
| |
ok pd, kn, deraadt
|
|
|
|
|
|
|
| |
Initializes the %drX registers to power on defaults, and bump the VM
send/recieve header to reflect same
discussed with deraadt@
|
|
|
|
|
|
|
|
|
| |
if a bootdevice was forced. This implements both the pure IO port interface
and also the new DMA interface, a few direct commands are implemented which
are needed but in general the "file" interface should be used. There is no
write support for the guest. Tested against the latest vmm-firmware port.
This requires also a -current kernel to pass the IO ports to vmd(8).
OK mlarkin@ ccardenas@
|
|
|
|
|
|
|
|
| |
currently only when booting a OpenBSD kernel. If VMBOOTDEV_NET is used the
internal dhcp server will pass "auto_install" as boot file to the client and
the boot loader passes the MAC of the first interface to the kernel to indicate
PXE booting. Adding boot order support to SeaBIOS is not yet implemented.
Ok ccardenas@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This works is from Ori Bernstein, committing on his behalf:
Add support to vmd for external snapshots. That is, snapshots that are
derived from a base image. Data lookups start in the derived image,
and if the derived image does not contain some data, the search
proceeds ot the base image. Multiple derived images may exist off of
a single base image.
A limitation of this format is that modifying the base image will
corrupt the derived image.
This change also adds support for creating disk derived disk images to
vmctl. To use it:
vmctl create derived.qcow2 -s 16G -b base.qcow2
From Ori Bernstein
OK mlarkin@ reyk@
|
|
|
|
| |
OK mlarkin@
|
|
|
|
|
|
|
|
|
|
|
| |
- qcow2: general cleanup
- vioraw: check malloc
- virtio: add function to sync disks
- vm: call virtio_shutdown to sync disks when vm is finished executing
Thanks to Ori Bernstein.
Ok miko@
|
|
|
|
| |
ok pd@
|
|
|
|
|
|
|
| |
avoiding multiple readregs ioctls back to vmm in case register content
is needed subsequently.
ok phessler
|
| |
|
| |
|
| |
|
|
|
|
| |
ok guenther
|
|
|
|
|
|
|
| |
Allow PIT channel 2 status (fired/counting) readback via port 0x61
bit 5.
ok guenther@
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Adds 'cdrom' keyword to vm.conf(5) and '-r' to vmctl(8)
* Support various sized ISOs (Limitation of 4G ISOs on Linux guests)
* Known working guests: OpenBSD (primary), Alpine Linux (primary),
CentOS 6 (secondary), Ubuntu 17.10 (secondary).
NOTE: Secondary indicates some issue(s) preventing full/reliable
functionality outside the scope of the vioscsi work.
* If the attached disks are non-bootable (i.e. empty), SeaBIOS (vmd's
default BIOS) will boot from CD-ROM.
ok mlarkin@, jca@
|
|
|
|
|
|
| |
usermode daemons handle that.
ok pd@
|
| |
|
|
|
|
| |
ok jsg
|
|
|
|
| |
ok mlarkin@
|
|
|
|
|
|
|
| |
This was missed in receive. mc146818_start is already defined. This fixes rtc
time resync on receive.
ok mlarkin@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
iovec_mem() populates an iovec array based on guest physical
addresses. this allows the use of things like readv and writev for
moving data between the guest and a disk image file without having
to bounce the memory.
vaddr_mem() provides a vmd usable pointer based on a guests physical
address. this makes it possible to directly reference things like
virtio rings without having to bounce that memory either. however,
it assumes that a contiguous range of guest physical memory will
sit in a single vm memory range. mlarkin@ says this is right.
ok mlarkin@
|
|
|
|
|
|
|
|
|
|
| |
This restricts receiving vms from hosts with more cpu features.
Tested on
broadwell -> skylake (works)
skylake -> broadwell (don't work)
ok mlarkin@
|
|
|
|
| |
based on proper values from the host in use.
|
|
|
|
| |
ok reyk@ and mlarkin@
|
|
|
|
|
|
| |
With help from Ashwin Agrawal
ok reyk@ mlarkin@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
previous version was allowing an output rate that is "too fast", and linux
guests would give up after 512 characters TXed ("too much work for irq4").
This diff calculates the approximate rate we can sustain at the current
programmed baud rate and limits the output to that rate by inserting a
HZ delay after a specified number of characters have been transmitted.
This fixes the linux guest console issue.
Note that the console now outputs at more or less the selected baud rate,
instead of nearly instantaneously as before - if you selected 9600 in
your guest VMs before, you might want to change that to 115200 now for a
better console experience.
krw@ "seems like a good idea to me"
|
|
|
|
| |
async io operations. ok mlarkin
|
|
|
|
|
| |
Also, fix a comment that wasn't applicable anymore, and change a format
from decimal to hex
|
|
|
|
|
| |
imsg_compose() on the "vmm_pipe" directly. This fixes the
communication channel from VMs back to vmm.
|
|
|
|
|
|
| |
Usermode part of previous vmm(4) diff.
Posted to tech by Pratik Vyas
|
| |
|
|
|
|
| |
ok kettenis
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a local interface is configured, vmd configures a /31 address on
the tap(4) interface of the host and provides another IP in the same
subnet via DHCP (BOOTP) to the VM. vmd runs an internal BOOTP server
that replies with IP, gateway, and DNS addresses to the VM. The
built-in server only ever responds to the VM on the inside and cannot
leak its DHCP responses to the outside.
Thanks to Uwe Werler, Josh Grosse, and some others for testing!
OK deraadt@
|
| |
|
|
|
|
|
|
| |
to get started and let more people help finding and fixing bugs.
ok kettenis, deraadt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of using the internal "vmboot", VMs will now be booted using
the external BIOS firmware in /etc/firmware/vmm-bios (which is subject
to a LGPLv3 license). Direct booting of OpenBSD kernels or
non-default BIOS images is still supported for now using the -b/boot
option that is replacing the -k/kernel option.
As requested by Theo, vmd(8) fails if neither the default BIOS is
found nor a kernel has been specified in the VM configuration. The
"vmm" BIOS has to be installed using fw_update(1), which will be done
automatically in most cases where the OpenBSD can fetch it after
install/upgrade.
OK mlarkin@
|
|
|
|
|
|
| |
pci emulation.
ok kettenis
|