summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bhyvectl
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2013-12-12 20:34:04 +0000
committerjhb <jhb@FreeBSD.org>2013-12-12 20:34:04 +0000
commit44bab93625a7a80c774a63f86cb7fb79f3439d55 (patch)
treec092b365d4caaf425e3bc279baa0f7a0421369d4 /usr.sbin/bhyvectl
parentc4cbbc15fb4feb922de70828a62f86c2b0624815 (diff)
downloadFreeBSD-src-44bab93625a7a80c774a63f86cb7fb79f3439d55.zip
FreeBSD-src-44bab93625a7a80c774a63f86cb7fb79f3439d55.tar.gz
Add a command to inject an NMI on a specific vcpu. It is a simple
wrapper around the existing vm_inject_nmi(). Reviewed by: grehan, neel
Diffstat (limited to 'usr.sbin/bhyvectl')
-rw-r--r--usr.sbin/bhyvectl/bhyvectl.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.sbin/bhyvectl/bhyvectl.c b/usr.sbin/bhyvectl/bhyvectl.c
index 0e92204..1b68776 100644
--- a/usr.sbin/bhyvectl/bhyvectl.c
+++ b/usr.sbin/bhyvectl/bhyvectl.c
@@ -189,12 +189,14 @@ usage(void)
" [--set-mem=<memory in units of MB>]\n"
" [--get-lowmem]\n"
" [--get-highmem]\n"
- " [--get-gpa-pmap]\n",
+ " [--get-gpa-pmap]\n"
+ " [--inject-nmi]\n",
progname);
exit(1);
}
static int get_stats, getcap, setcap, capval, get_gpa_pmap;
+static int inject_nmi;
static const char *capname;
static int create, destroy, get_lowmem, get_highmem;
static uint64_t memsize;
@@ -557,6 +559,7 @@ main(int argc, char *argv[])
{ "run", NO_ARG, &run, 1 },
{ "create", NO_ARG, &create, 1 },
{ "destroy", NO_ARG, &destroy, 1 },
+ { "inject-nmi", NO_ARG, &inject_nmi, 1 },
{ NULL, 0, NULL, 0 }
};
@@ -825,6 +828,10 @@ main(int argc, char *argv[])
vmcs_entry_interruption_info);
}
+ if (!error && inject_nmi) {
+ error = vm_inject_nmi(ctx, vcpu);
+ }
+
if (!error && (get_lowmem || get_all)) {
gpa = 0;
error = vm_get_memory_seg(ctx, gpa, &len, &wired);
OpenPOWER on IntegriCloud