Age | Commit message (Collapse) | Author |
|
set proper return data size (don't clobber high %eax bits). Also apply
a mask on incoming data (from OUT instruction in guest) to avoid
misinterpreting register index values. Found when implementing Linux and
seabios support.
|
|
high bits.
|
|
warn with the same severity. Switch log_warn() to LOG_ERR and keep
fatal() at LOG_CRIT.
OK reyk@ florian@
|
|
high bits of %eax on reading register data from the emulated UART ports.
The second error didn't properly assert the TXRDY bit during init -
this bit was only set after the first character was sent. Both these
bugs caused seabios to not be able to output any data. Found during the
recent effort to get Linux guests booting.
|
|
operating in BCD mode. Linux assumes the RTC will be in BCD mode by default
and if not, it does a WARN_ON warning about this, and misinterprets the RTC
TOD registers.
Tested with existing vmd/vmm guests with what's in tree.
|
|
automatically. This worked for OpenBSD guests but breaks seabios as soon
as the first interrupt fires since it has not programmed the PIT to do
anything yet. And OpenBSD reprograms the clock to rategen mode as soon
as it boots anyway, so this still works with vmctl(8)'s -k option, as
well as the faux-bootloader implemented in vmd(8)
|
|
(respectively). Seabios uses 0x8/0x78 and linux uses 0x30/0x38. Respond
properly to PIC vector base assignment and calculate VMX injection
vectors based on current values, instead of always assuming OpenBSD
defaults.
Needed for both seabios serial console support as well as linux guest
support. Tested on -current as is, does not break existing OpenBSD
guest support.
|
|
in debugging output.
|
|
- Don't start a VM that is already running
- Keep the VM as running until it is powered off (and not stopping)
- Don't fatal in the parent if the vmm process referenced an unknown VM
- Don't stop a VM that is already stopping
- Indicate that a VM is stopping in "vmctl status"
The previous "vmctl stop; vmctl stop" to force-shutdown is not
supported anymore - the shutdown timeout should make sure that the VM
is really terminated. To force-shutdown, reference the VM by ID.
We might add a flag to vmctl stop to just turn the VM off.
|
|
This change handles various cases to power off the VM, even if it is
unresponsive, stuck in ddb, or when the shutdown was initiated from
the VM guest side. Usage of timeout and VM ACKs make sure that the VM
is really turned off at some point.
OK mlarkin@
|
|
The parent keeps a copy of each VM's tty fd to reuse it on reboot.
Close this tty if the VM was stopped, and not rebooted, by calling
vm_stop(vm, 0) instead of just setting vm_running to 0. Also make
sure that vm_ttyname is not used after free'ing it.
|
|
When a start vm request is received from vmctl via the control socket,
vmd's control process forwards it to the parent to trigger the action.
A response is received later, in an async way, and send back to vmctl
that is supposed to wait for it. But now, if vmctl got terminated
before receiving the response, vmd fails to find the control
connection. In this case it should not abort, print and warning, and
ignore the error. The fix is a simple as changing a return (-1) to a
return (0).
This fixes an issue that was reported by mlarkin@
|
|
This is especially useful when multiple VMs share a switch, the
implementation is independent from the underlying switch or bridge.
no objections mlarkin@
|
|
As discussed with mlarkin@, it makes it easier to maintain the file.
OK mlarkin@
|
|
|
|
This allows matching users to start or stop VMs that they "own" and to
access the console accordingly.
OK mlarkin@
|
|
OK mlarkin@
|
|
This allows more flexibility for upcoming changes and better pledge.
We also didn't use half of the features of libutil's openpty function.
Additionally, make sure that the ttys are closed correctly on shutdown.
OK gilles@
|
|
Additionally, make sure that vmd never fatal()s when receiving an
invalid imsg from an arbitrary user over the control socket.
OK gilles@
|
|
vmm VMs don't support powerdown - no ACPI or power management - so we
use a trick to issue a reboot and just don't reset after the triple
fault. This worked before but was broken with the previous fix to
pvbus_shutdown() - move the trick to vmd instead.
OK mlarkin@
|
|
|
|
|
|
|
|
|
|
OK kettenis@ mlarkin@
|
|
steal code.
|
|
The semantics agreed with reyk@ are:
* ad-hoc created vms, created with `vmctl start`, are removed once stopped.
* Stopped VMs defined in a config file are flushed before a `vmctl reload`.
OK reyk@
|
|
|
|
It currently uses the device to request graceful shutdown of a VM on
"vmctl stop myvm" but will be extended for reboot and a other edge cases.
OK mlarkin@
|
|
For now, this is only used to forward "log verbose|brief" requests,
but it will be used for better things later.
OK mlarkin@
|
|
No function change.
|
|
This replaces log_verbose() and "extern int verbose" with the two functions
log_setverbose() and log_getverbose().
Pointed out by benno@
OK krw@ eric@ gilles@ (OK gilles@ for the snmpd bits as well)
|
|
TAILQ_FOREACH().
No intentional functional change.
ok reyk@
|
|
were being printed because vmm(4) was in the middle of processing an exit
that vmd(8) didn't care about, but still exited to vmd(8) because of
a pending interrupt.
|
|
modern TAILQ_FOREACH_SAFE().
No intentional functional change.
ok millert@ bluhm@ gilles@
|
|
with more modern TAILQ_FOREACH(). This what symget() was already
doing.
Add paranoia '{}' around body of symget()'s TAILQ_FOREACH().
No intentional functional change.
ok bluhm@ otto@
|
|
With testing from Jon Bernard
OK mlarkin@
|
|
This is technically a reset since memory is cleared and the dmesg
buffer is lost.
Patch from Jon Bernard (jbernard at jbernard.io) - Thanks
OK reyk@ mlarkin@
|
|
pty and re-send it to the vmm monitor process. With additional
changes in vmm.c, this will allow perform a cold reboot of VM.
With testing and feedback from Jon Bernard
OK mlarkin@
|
|
|
|
|
|
Like the real boot loader, load and parse hd0a:/etc/boot.conf from the
first disk and fall back to /bsd. Not all boot loader options are
supported, but it at least does set device, set image, and boot -acds
(eg. for booting single-user).
For example, it can now boot install60.fs that includes a boot.conf
with "set image /6.0/amd64/bsd.rd":
vmctl start install -c -d install60.fs -d OpenBSD.img
This pseudo-bootloader is only needed without BIOS and could
potentially be replaced in the future.
OK mlarkin@
|
|
Default value picked with mlarkin - not too small and not too large.
OK mlarkin@
|
|
Implement some bits of the device reset and don't do DMA if the DRIVER_OK bit
is not set. This is enough to avoid vio(4) panicking on if down/up.
Tested by rzalamena@ and mikeb@
OK reyk@
|
|
It was nothing more than a wrapper around fork(2).
OK edd@ and mlarkin@
|
|
|
|
|
|
effect in log_debug(), log_warn*() and all the other logging
functions.
|
|
|
|
|