| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Inject a pending interrupt even if the rcv_pending flag is set to avoid the
endless EV_READ loop where a byte lingers read to be read but the vcpu never
gets the interrupt to read it. (e.g. the result of spamming RETURN via the
serial console)
Also, protect com ratelimit handler with mutexes to avoid corruption of the
device state.
These changes help preventing linux vm crashes when the return key is held on
boot.
Discovered by and patch from Dave Voutila <dave@sisu.io>
ok tb@
|
|
|
|
|
|
|
| |
vm would get stuck if disconnected from console and get unstuck once console is
attached.
Spotted by tb@
|
|
|
|
|
|
|
|
|
|
|
|
| |
Inject pending interrupt if com has receive pending. This was previously
accidently checked in with an unrelated change by Mike Larkin and was backed out
as it didn't fix the intended problem.
Also, protect com ratelimit handler with mutexes to avoid corruption of the
device state. These changes help preventing linux vm crashes when the return
key is held on boot.
Discovered by and patch from Dave Voutila <dave@sisu.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I completely missed that part from vmctl.5's "LOCAL INTERFACES" section.
Reading `-L's description itself and the fact that it functions as a
boolean switch contrary to how `-i' expects a number, I made the wrong
assumption that it can only work for the first interface.
"vmctl -Li2" configures two interfaces, one witch DHCP and one without.
"vmctl -L -L" however configures two interfaces with DHCP IPs each.
My second mistake was to imply analogue behaviour for the configuration.
Now that you stated the obvious about `local' being per `interface' line,
it makes absoloutely no sense to above mentioned behaviour for static VM
definitions.
Pointed out by tb
|
|
|
|
|
|
|
| |
A VM can have multiple interfaces, but only the first one gets DHCP
if "-L" (vmctl) or "local" (vm.conf) is specified.
Positive feedback Mike Larkin
|
|
|
|
|
| |
manual pages that document the corresponding configuration files;
OK jmc@, and general direction discussed with many
|
|
|
|
|
|
|
|
|
|
| |
try to document and enumerate them.
This is most helpful when you try to assign the 5th interface to a guest,
and are confused why vmd(8) won't start the guest when only 4 tap devices
exist.
OK jmc@, kn@, pamela@
|
|
|
|
| |
The parameter block must not be omitted, so remove the Op markup.
|
|
|
|
| |
applied to "owner" too;
|
|
|
|
|
|
| |
into one logical item;
ok pd
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Omitting the owner value is not documented and ought to be rather invalid
syntax, but it parses as "[socket] owner root:wheel" which is the same as
simply omitting the owner line entirely.
Require a value, that is treat "socket owner" and "owner" as invalid syntax
and fail.
OK denis
|
|
|
|
|
|
|
|
|
|
|
|
| |
This addresses 'thundering herd' problem when a lot of
vms are configured in vm.conf. A lot of vms booting in parallel can
overload the host and also mess up tsc calibration in openbsd guests as
it uses PIT which doesn't fire reliably if the host is overloaded.
We default to starting vms with parallelism of ncpuonline and a delay 30 seconds
between batches. This is configurable in vm.conf.
ok mlarkin@ (also addressed comments from cheloha@)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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@
|
|
|
|
|
|
|
|
|
| |
the "Fix at least one cause of VMs spinning at 100% host CPU" commit)
accidentally included some pieces of a different WIP. These pieces
remained in the tree after the revert and caused vmd to busy loop
after attaching to and detaching from a VM's console.
"please commit" 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@
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
error prone than manually editing rc.conf.local, and also works to
enable ipsec and accounting.
tweak from schwarze@ to use the \(dq\(dq syntax for quotes in '.Dl
foo_flags="" lines' instead of \&"\&".
while at it, fix a reference to a bogus /dev/dhclient.conf file that
recently snuck in.
ok jmc@ deraadt@ schwarze@
|
|
|
|
|
|
|
|
|
|
| |
The function argument is not checked at all and the only caller in config.c
always passes a buffer valid buffer.
Defer the error case's default value to the end to avoid rewriting in case
a node is opened.
Feedback and OK reyk
|
|
|
|
|
|
|
| |
Print the guest %rip when it tries to do I/O to a nonexistent port.
Also convert the message to a DPRINTF so that it doesn't leak
guest address information into any logging the host might be doing
under normal non-debug conditions.
|
|
|
|
| |
ok deraadt@
|
|
|
|
| |
ok reyk, mpi, benno, tb
|
| |
|
|
|
|
| |
ok mlarkin@
|
|
|
|
| |
Found by Hiltjo Posthuma, thanks!
|
|
|
|
|
|
|
| |
start. Favoring 'invalid template' over 'permission denied' should give
the user a better hint on what went wrong.
ok kn@ mlarkin@
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
Remove the scratch register (8250s don't have this), and reorganize
some constants to be able to more easily support more than one serial
port in the future.
ok deraadt
Diff from Katherine Rohl, thanks!
|
|
|
|
|
|
|
| |
These never got unset on AMD/SVM guests when booted via vmctl start
-b causing them to run very slow
ok mlarkin@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
if something changed in register A.
when updating register A we were checking in register B if the
PIE bit was set in order to decide if rtc_reschedule_per needed
to be called. if that bit was changed then the timer rate would
already have been adjusted by rtc_update_regb so the call from
rtc_update_rega is not needed.
this now matches what qemu and other emulators are doing too.
ok mlarkin@
|
|
|
|
|
|
|
|
| |
to crash vmd and take all other vms with it. this required a little
shuffling to get the error value reported back to the caller to
handle the error properly.
ok mlarkin@
|
|
|
|
|
|
|
| |
Define a local definition of LOADADDR() instead of pulling in
machine/loadfile_machdep.h. vmd -b requires the addresses to be masked
and the new bootloader no longer does that.
OK pd@ kettenis@
|
|
|
|
| |
Part of a patch from Stephen Gregoratto <dev at sgregoratto dot me>.
|
|
|
|
|
|
| |
counterpart from vmctl.
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@
|
|
|
|
|
|
|
| |
the vcpu (which is why it got removed), it now actually reports the correct state
(running, stopped, disabled, paused, etc)
ok ccardenas@ 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@
|
|
|
|
|
|
| |
knows the vm is paused, but vmd does not.
ok mlarkin@ pd@
|
|
|
|
| |
ok pd@
|
|
|
|
|
|
|
|
|
|
|
|
| |
vm console. Instead, wait for the controlling end of the pty to become
writeable, which implies that the slave end is connected. A recent
change to the kqueue pty implementation caused vmd to hammer the log due
to constantly hitting EOF while reading from the pty since the slave end
was disconnected.
Issue found the hard way by mlarkin@ and tb@
ok mlarkin@
|
|
|
|
|
|
|
|
| |
`start' requires an alphanumeric VM name, must not be a number and in fact
must not start with a digit. Improve and simplify the current requirements
as starting with a letter directly implies all of the above.
OK mlarkin, feedback jmc
|
|
|
|
| |
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@
|
|
|
|
|
|
| |
larger types really is a range reduction...
Almost any cast to (unsigned) is a bug.
ok millert tb benno
|