summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreyk <reyk@openbsd.org>2017-02-13 18:49:01 +0000
committerreyk <reyk@openbsd.org>2017-02-13 18:49:01 +0000
commita4ba39133c2b88f3393c4b23e9efb88702f0d87c (patch)
tree043da16031167bc6d5a94f2d1970a0299bd1d6a1
parentTest IPsec with AH the same way it is already done for ESP. (diff)
downloadwireguard-openbsd-a4ba39133c2b88f3393c4b23e9efb88702f0d87c.tar.xz
wireguard-openbsd-a4ba39133c2b88f3393c4b23e9efb88702f0d87c.zip
Fix powerdown with vmmci(4) VMs using a shutdown and no reset.
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@
-rw-r--r--usr.sbin/vmd/virtio.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.sbin/vmd/virtio.c b/usr.sbin/vmd/virtio.c
index d22066db949..b642e64653a 100644
--- a/usr.sbin/vmd/virtio.c
+++ b/usr.sbin/vmd/virtio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: virtio.c,v 1.31 2017/01/21 11:36:54 reyk Exp $ */
+/* $OpenBSD: virtio.c,v 1.32 2017/02/13 18:49:01 reyk Exp $ */
/*
* Copyright (c) 2015 Mike Larkin <mlarkin@openbsd.org>
@@ -1201,6 +1201,13 @@ vmmci_ctl(unsigned int cmd)
/* Update command */
vmmci.cmd = cmd;
+ /*
+ * vmm VMs do not support powerdown, send a reboot request
+ * instead and turn it off after the triple fault.
+ */
+ if (cmd == VMMCI_SHUTDOWN)
+ cmd = VMMCI_REBOOT;
+
/* Trigger interrupt */
vmmci.cfg.isr_status = VIRTIO_CONFIG_ISR_CONFIG_CHANGE;
vcpu_assert_pic_irq(vmmci.vm_id, 0, vmmci.irq);