summaryrefslogtreecommitdiff
path: root/usr.sbin/vmd
AgeCommit message (Collapse)Author
2017-06-12device path should be PATH_MAX. Any NAME_MAX without +1 is suspectTheo de Raadt
to begin with anyways.
2017-06-07vmd: Implement simulated baudrate support in the ns8250 module. TheMike Larkin
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"
2017-06-07vmd: properly advertise 640k base memory, not 636k. That was a holdoverMike Larkin
from before we had seabios support (to fake a hole where the EBDA would be), and seabios always assumes 640k low memory is available. Fixes a problem where FreeDOS guests whose seabios placed the virtio ring too close to 640k would crash vmd. tested on a variety of guest OS, with and without seabios. no regressions seen.
2017-05-30split vioblk read/write functions into start and finish as prep forTed Unangst
async io operations. ok mlarkin
2017-05-30increase vmd(8) virtio queue size from 64 to 128. Also fix an oldMike Larkin
copypaste bug that didn't hurt us as long as all the queue sizes were the same, which was the case up to now. suggested by sf@, ok krw@
2017-05-29sync proc.c changes from relayd/httpdSebastian Benoit
2017-05-29vmd(8): prevent crashing when presented with a vm name argument toMike Larkin
"vmctl stop" that doesn't exist. Diff from Pratik Vyas, thanks!
2017-05-28SVM: add some exit typesMike Larkin
Also, fix a comment that wasn't applicable anymore, and change a format from decimal to hex
2017-05-27use pread and pwrite to save code and syscalls. ok mlarkinTed Unangst
2017-05-11typo, spotted by dhill.Mike Larkin
ok reyk@
2017-05-08Adds functions to read and write state of devices in vmd.Reyk Floeter
This is required for implementing vmctl send and vmctl receive. vmctl send / receive are two new options that will support snapshotting VMs and migrating VMs from one host to another. The atomicio files are copied from usr.bin/ssh. Patch from Pratik Vyas; this project was undertaken at San Jose State University along with his three teammates, Ashwin, Harshada and Siri with mlarkin@ as the advisor. OK mlarkin@
2017-05-05VMs cannot use proc_compose() to PROC_VMM, they have to useReyk Floeter
imsg_compose() on the "vmm_pipe" directly. This fixes the communication channel from VMs back to vmm.
2017-05-05Allow vmd(8) to set guest %xcr0Mike Larkin
Usermode part of previous vmm(4) diff. Posted to tech by Pratik Vyas
2017-05-04Report command failure back to vmctl reload, reset, load, log verbose.Reyk Floeter
OK mlarkin@
2017-05-04Report error for vmctl commands that need root privileges.Reyk Floeter
specifically: vmctl (load|reload|reset|log) Reported by Christian Barthel
2017-05-04Add support for rdomains.Reyk Floeter
This allows to configure VM interfaces and switches in individual rdomains. OK mlarkin@
2017-05-03Sort parser tokens, no functional changeReyk Floeter
2017-05-02Resynchronize the guest RTC via vmmci(4) on host resume from zzz/ZZZMike Larkin
(vmd part) This feature is for OpenBSD guests only. ok reyk, kettenis
2017-05-02fix an error in i386 vmd buildMike Larkin
2017-05-02Matching vmd(8) part of previous diff (first part of vmctl send/receive).Mike Larkin
ok kettenis
2017-04-28rename i8253 "counter" to "channel", a better name for what we areMike Larkin
emulating
2017-04-25Generate randomized MAC addresses earlier to keep them across reboots.Reyk Floeter
OK deraadt@
2017-04-25spacingReyk Floeter
2017-04-24Don't overflow the allocated DHCP response buffer.Reyk Floeter
When copying the DHCP/BOOTP response into the allocated buffer, use the calculated response length instead of the maximum size of a DHCP packet. The response length was verified correctly but the very last step missed to use it. Found by Caspar Schutijser and malloc.conf(5) "S" OK deraadt@
2017-04-21Fail if vm.conf exists but cannot be opened, ignore if it doesn't exist.Reyk Floeter
This fixes 'vmd -nf /etv/vm.conf' if the file is not readable.
2017-04-21Add global configuration option "local prefix" to change prefix for -L.Reyk Floeter
The default prefix is 100.64.0.0/10 from RFC6598. Requested by sthen@ chris@ OK mlarkin@
2017-04-21vmd(8) pci emulation fix required for upcoming option rom support.Mike Larkin
This will be used in the future to support an sgabios option rom, to do VGA text mode console redirection. ok reyk
2017-04-19Add support for dynamic "NAT" interfaces (-L/local interface).Reyk Floeter
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@
2017-04-08change a log message from "warn" to "debug" level, as the condition it isMike Larkin
reporting is not actually a warning.
2017-04-08implement nonspecific EOI mode for the legacy PICMike Larkin
ok deraadt
2017-04-08implement channels 1 and 2 of the legacy PIT.Mike Larkin
ok otto, deraadt
2017-04-06"kernel" got renamed to "boot" in vm.conf but I didn't commit the parse.y bits.Reyk Floeter
Found by Pontus Lundkvist OK deraadt
2017-04-06Do not expose vmm(4) VM IDs to the user, use vmd(8)'s IDs instead.Reyk Floeter
Each VM has two IDs: one from the kernel (vmm) and a different one from userland (vmd). The vmm ID is not consistent and incremented on every boot during runtimg of the host system. The vmd ID remains the same during the lifetime of a configured VM, even after reboots. Configured VMs will even get and keep their IDs when the configuration is loaded. This is more what users expect. Pointed out and tested by otto@ OK deraadt@
2017-03-27die whitespace die die dieTheo de Raadt
2017-03-26Implement a missing command in vioblk and allow > MAXPHYS transfers.Mike Larkin
This diff (with the others previously committed) allows ubuntu 14.04 amd64 guests to work.
2017-03-26Don't compare kernel and root disk name if both strings are empty.Reyk Floeter
This avoids jumping into vmboot in some edge conditions. OK mlarkin@
2017-03-26With the updated get_input_data() interface, we need to zero-initializeMark Kettenis
the stack variable that we use to store the data otherwise the bytes that aren't touched by get_input_data() may contain garbage. ok mlarkin@
2017-03-26Use the pseudo-bootloader if the boot image path matches the root disk path.Reyk Floeter
This allows to use the non-BIOS on-disk bootloader for testing. It might go away after release when we feel more confident about BIOS. OK mlarkin@
2017-03-25Last bits needed to get seabios + alpine linux working. This is enoughMike Larkin
to get started and let more people help finding and fixing bugs. ok kettenis, deraadt
2017-03-25Process more than one avail slot in vioblk ring, if requested by theMike Larkin
guest VM. We probably need to do this same fix for vionet later.
2017-03-25Boot using BIOS from /etc/firmware/vmm-bios by default.Reyk Floeter
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@
2017-03-25The virtio spec says isr_status should be cleared to 0 on read, whichMike Larkin
we were not doing. That confused the virtio subsystem in linux.
2017-03-25implement missing vioblk reset function and improve the partiallyMike Larkin
implemented vionet one
2017-03-25Implement some missing functionality and clean up some code in vmdMike Larkin
pci emulation. ok kettenis
2017-03-25Introduce a new function to obtain properly sized input data, and convertMike Larkin
i8253/i8259/mc146818 emulation to use this.
2017-03-24Backout mlarkin's previous commit while he is away:Reyk Floeter
The newly-used function get_input_data() is missing and broke the tree.
2017-03-24Last bits of cleanup for linux/seabios support in i8253/i8259 emulationMike Larkin
code.
2017-03-24Allow vmd to proceed after an interrupt occurred after retiring a cpuidMike Larkin
instruction. Matches previous commit to kernel vmm.c
2017-03-23Implement memory size and SMP CPU count NVRAM registers in the emulatedMike Larkin
mc146818. This is needed for seabios to boot properly (and construct a sensible e820 map to send to the guest OS).
2017-03-23Various i8253/i8254 implementation improvements - Fix an error that usedMike Larkin
the wrong i/o latch index on reads (resulting in erratic counter values possibly being read). Also do proper return size setting (don't clobber %eax high bits). This diff also implements counter readback mode, which is used in seabios.