aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/bhyvectl
diff options
context:
space:
mode:
authorRodney W. Grimes <rgrimes@FreeBSD.org>2018-04-08 19:24:49 +0000
committerRodney W. Grimes <rgrimes@FreeBSD.org>2018-04-08 19:24:49 +0000
commit01d822d33b0cd1f801ce39d0ed25fa7f57b5a429 (patch)
tree6e62af630c4d1ea3fb4b4d5e1b23dfe38ea44c9d /usr.sbin/bhyvectl
parent92223bddedf0f8b964a62904f065b12563db8ae9 (diff)
Notes
Diffstat (limited to 'usr.sbin/bhyvectl')
-rw-r--r--usr.sbin/bhyvectl/bhyvectl.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/usr.sbin/bhyvectl/bhyvectl.c b/usr.sbin/bhyvectl/bhyvectl.c
index d492e0828bcd..42cf7d91a11a 100644
--- a/usr.sbin/bhyvectl/bhyvectl.c
+++ b/usr.sbin/bhyvectl/bhyvectl.c
@@ -191,7 +191,8 @@ usage(bool cpu_intel)
" [--get-msr-bitmap]\n"
" [--get-msr-bitmap-address]\n"
" [--get-guest-sysenter]\n"
- " [--get-exit-reason]\n",
+ " [--get-exit-reason]\n"
+ " [--get-cpu-topology]\n",
progname);
if (cpu_intel) {
@@ -285,6 +286,7 @@ static int set_x2apic_state, get_x2apic_state;
enum x2apic_state x2apic_state;
static int unassign_pptdev, bus, slot, func;
static int run;
+static int get_cpu_topology;
/*
* VMCB specific.
@@ -1456,6 +1458,7 @@ setup_options(bool cpu_intel)
{ "get-active-cpus", NO_ARG, &get_active_cpus, 1 },
{ "get-suspended-cpus", NO_ARG, &get_suspended_cpus, 1 },
{ "get-intinfo", NO_ARG, &get_intinfo, 1 },
+ { "get-cpu-topology", NO_ARG, &get_cpu_topology, 1 },
};
const struct option intel_opts[] = {
@@ -2312,6 +2315,14 @@ main(int argc, char *argv[])
}
}
+ if (!error && (get_cpu_topology || get_all)) {
+ uint16_t sockets, cores, threads, maxcpus;
+
+ vm_get_topology(ctx, &sockets, &cores, &threads, &maxcpus);
+ printf("cpu_topology:\tsockets=%hu, cores=%hu, threads=%hu, "
+ "maxcpus=%hu\n", sockets, cores, threads, maxcpus);
+ }
+
if (!error && run) {
error = vm_run(ctx, vcpu, &vmexit);
if (error == 0)