diff options
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bhyve/bhyverun.c | 6 | ||||
-rw-r--r-- | usr.sbin/bhyvectl/bhyvectl.c | 23 |
2 files changed, 5 insertions, 24 deletions
diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index 8d03649..ea4b68c 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -520,13 +520,17 @@ static vmexit_handler_t handler[VM_EXITCODE_MAX] = { static void vm_loop(struct vmctx *ctx, int vcpu, uint64_t rip) { + cpuset_t mask; int error, rc, prevcpu; if (guest_vcpu_mux) setup_timeslice(); if (pincpu >= 0) { - error = vm_set_pinning(ctx, vcpu, pincpu + vcpu); + CPU_ZERO(&mask); + CPU_SET(pincpu + vcpu, &mask); + error = pthread_setaffinity_np(pthread_self(), + sizeof(mask), &mask); assert(error == 0); } diff --git a/usr.sbin/bhyvectl/bhyvectl.c b/usr.sbin/bhyvectl/bhyvectl.c index 35e1388..4eb87f9 100644 --- a/usr.sbin/bhyvectl/bhyvectl.c +++ b/usr.sbin/bhyvectl/bhyvectl.c @@ -183,8 +183,6 @@ usage(void) " [--get-vmcs-exit-interruption-info]\n" " [--get-vmcs-exit-interruption-error]\n" " [--get-vmcs-interruptibility]\n" - " [--set-pinning=<host_cpuid>]\n" - " [--get-pinning]\n" " [--set-x2apic-state=<state>]\n" " [--get-x2apic-state]\n" " [--set-lowmem=<memory below 4GB in units of MB>]\n" @@ -218,7 +216,6 @@ static int set_desc_tr, get_desc_tr; static int set_desc_ldtr, get_desc_ldtr; static int set_cs, set_ds, set_es, set_fs, set_gs, set_ss, set_tr, set_ldtr; static int get_cs, get_ds, get_es, get_fs, get_gs, get_ss, get_tr, get_ldtr; -static int set_pinning, get_pinning, pincpu; static int set_x2apic_state, get_x2apic_state; enum x2apic_state x2apic_state; static int run; @@ -374,7 +371,6 @@ enum { SET_SS, SET_TR, SET_LDTR, - SET_PINNING, SET_X2APIC_STATE, SET_VMCS_EXCEPTION_BITMAP, SET_VMCS_ENTRY_INTERRUPTION_INFO, @@ -423,7 +419,6 @@ main(int argc, char *argv[]) { "set-ss", REQ_ARG, 0, SET_SS }, { "set-tr", REQ_ARG, 0, SET_TR }, { "set-ldtr", REQ_ARG, 0, SET_LDTR }, - { "set-pinning",REQ_ARG, 0, SET_PINNING }, { "set-x2apic-state",REQ_ARG, 0, SET_X2APIC_STATE }, { "set-vmcs-exception-bitmap", REQ_ARG, 0, SET_VMCS_EXCEPTION_BITMAP }, @@ -552,7 +547,6 @@ main(int argc, char *argv[]) NO_ARG, &get_vmcs_exit_interruption_error, 1}, { "get-vmcs-interruptibility", NO_ARG, &get_vmcs_interruptibility, 1 }, - { "get-pinning",NO_ARG, &get_pinning, 1 }, { "get-x2apic-state",NO_ARG, &get_x2apic_state, 1 }, { "get-all", NO_ARG, &get_all, 1 }, { "run", NO_ARG, &run, 1 }, @@ -659,10 +653,6 @@ main(int argc, char *argv[]) ldtr = strtoul(optarg, NULL, 0); set_ldtr = 1; break; - case SET_PINNING: - pincpu = strtol(optarg, NULL, 0); - set_pinning = 1; - break; case SET_X2APIC_STATE: x2apic_state = strtol(optarg, NULL, 0); set_x2apic_state = 1; @@ -812,9 +802,6 @@ main(int argc, char *argv[]) if (!error && set_ldtr) error = vm_set_register(ctx, vcpu, VM_REG_GUEST_LDTR, ldtr); - if (!error && set_pinning) - error = vm_set_pinning(ctx, vcpu, pincpu); - if (!error && set_x2apic_state) error = vm_set_x2apic_state(ctx, vcpu, x2apic_state); @@ -1135,16 +1122,6 @@ main(int argc, char *argv[]) printf("ldtr[%d]\t\t0x%04lx\n", vcpu, ldtr); } - if (!error && (get_pinning || get_all)) { - error = vm_get_pinning(ctx, vcpu, &pincpu); - if (error == 0) { - if (pincpu < 0) - printf("pincpu[%d]\tunpinned\n", vcpu); - else - printf("pincpu[%d]\t%d\n", vcpu, pincpu); - } - } - if (!error && (get_x2apic_state || get_all)) { error = vm_get_x2apic_state(ctx, vcpu, &x2apic_state); if (error == 0) |