summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2014-05-12 23:35:10 +0000
committerneel <neel@FreeBSD.org>2014-05-12 23:35:10 +0000
commitc0a09660e6c774d4d5b87158fd7e68b0b27d2893 (patch)
treeb04612916b46973bef14dd1caff7b3ca3dee592f /usr.sbin
parent4d2303530177123eec5f42beafddfda5636aec85 (diff)
downloadFreeBSD-src-c0a09660e6c774d4d5b87158fd7e68b0b27d2893.zip
FreeBSD-src-c0a09660e6c774d4d5b87158fd7e68b0b27d2893.tar.gz
abort(3) the process in response to a VMEXIT_ABORT. This usually happens in
response to an unhandled VM exit or an unexpected error so a core is useful. Remove unused macro VMEXIT_SWITCH. Reviewed by: grehan
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bhyve/bhyverun.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c
index e662ca3..f4a9111 100644
--- a/usr.sbin/bhyve/bhyverun.c
+++ b/usr.sbin/bhyve/bhyverun.c
@@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$");
#define GUEST_NIO_PORT 0x488 /* guest upcalls via i/o port */
-#define VMEXIT_SWITCH 0 /* force vcpu switch in mux mode */
#define VMEXIT_CONTINUE 1 /* continue from next instruction */
#define VMEXIT_RESTART 2 /* restart current instruction */
#define VMEXIT_ABORT 3 /* abort the vm run loop */
@@ -272,12 +271,6 @@ fbsdrun_deletecpu(struct vmctx *ctx, int vcpu)
}
static int
-vmexit_catch_inout(void)
-{
- return (VMEXIT_ABORT);
-}
-
-static int
vmexit_handle_notify(struct vmctx *ctx, struct vm_exit *vme, int *pvcpu,
uint32_t eax)
{
@@ -330,7 +323,7 @@ vmexit_inout(struct vmctx *ctx, struct vm_exit *vme, int *pvcpu)
fprintf(stderr, "Unhandled %s%c 0x%04x\n",
in ? "in" : "out",
bytes == 1 ? 'b' : (bytes == 2 ? 'w' : 'l'), port);
- return (vmexit_catch_inout());
+ return (VMEXIT_ABORT);
}
}
@@ -575,6 +568,8 @@ vm_loop(struct vmctx *ctx, int vcpu, uint64_t rip)
assert(error == 0 || errno == EALREADY);
rip = vmexit[vcpu].rip + vmexit[vcpu].inst_length;
break;
+ case VMEXIT_ABORT:
+ abort();
default:
exit(1);
}
OpenPOWER on IntegriCloud