diff options
author | John Baldwin <jhb@FreeBSD.org> | 2013-12-12 20:34:04 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2013-12-12 20:34:04 +0000 |
commit | eba633a62f6701470b496a4cdbe646a7b13f3750 (patch) | |
tree | c092b365d4caaf425e3bc279baa0f7a0421369d4 /usr.sbin | |
parent | e3b4f880030371ab48194de4253b4971819e25a5 (diff) | |
download | src-eba633a62f6701470b496a4cdbe646a7b13f3750.tar.gz src-eba633a62f6701470b496a4cdbe646a7b13f3750.zip |
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
Notes
Notes:
svn path=/head/; revision=259275
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bhyvectl/bhyvectl.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.sbin/bhyvectl/bhyvectl.c b/usr.sbin/bhyvectl/bhyvectl.c index 0e9220494e38..1b68776dca2e 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); |