summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorStefan Kempf <stefan@cvs.openbsd.org>2016-02-16 19:00:17 +0000
committerStefan Kempf <stefan@cvs.openbsd.org>2016-02-16 19:00:17 +0000
commit1d458a7f4c578dfa53b7edae59099464d23a08bb (patch)
tree2b5b117c7a8af9281208bf82999973c3437fdcf0 /usr.sbin
parenta3bbb4d33730659bcac215f1f3b80dcfa8f07879 (diff)
Pass down the initial value of CR0 down to the RESETCPU ioctl() as well.
This gives us the opportunity later to start VCPUs in real-mode, etc. (for those CPUs that support unrestricted guest). You need to build an updated kernel for this first, the ioctl interface has changed. ok mlarkin@, deraadt@
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/vmd/vmm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/vmd/vmm.c b/usr.sbin/vmd/vmm.c
index 119e0ac37e0..f58069fd3b4 100644
--- a/usr.sbin/vmd/vmm.c
+++ b/usr.sbin/vmd/vmm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmm.c,v 1.20 2016/01/16 08:55:40 stefan Exp $ */
+/* $OpenBSD: vmm.c,v 1.21 2016/02/16 19:00:16 stefan Exp $ */
/*
* Copyright (c) 2015 Mike Larkin <mlarkin@openbsd.org>
@@ -33,6 +33,7 @@
#include <dev/pci/pcireg.h>
#include <machine/param.h>
+#include <machine/specialreg.h>
#include <machine/vmmvar.h>
#include <errno.h>
@@ -164,6 +165,7 @@ static const struct vcpu_init_state vcpu_init_flat32 = {
0x2, /* RFLAGS */
0x0, /* RIP */
0x0, /* RSP */
+ CR0_CD | CR0_NW | CR0_ET | CR0_PE, /* CR0 */
0x0, /* CR3 */
{ 0x8, 0xFFFFFFFF, 0xC09F, 0x0}, /* CS */
{ 0x10, 0xFFFFFFFF, 0xC093, 0x0}, /* DS */