summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bhyve/spinup_ap.c
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2013-10-22 00:58:51 +0000
committerneel <neel@FreeBSD.org>2013-10-22 00:58:51 +0000
commitb31f0060b59a4d7ad2b7ddb3261a49fbdce0dad1 (patch)
tree9dfed47515f37a1e3685838506fddfadda2af8dd /usr.sbin/bhyve/spinup_ap.c
parent44f5357aec14c32040c49f1703b1d4c2cac5d080 (diff)
downloadFreeBSD-src-b31f0060b59a4d7ad2b7ddb3261a49fbdce0dad1.zip
FreeBSD-src-b31f0060b59a4d7ad2b7ddb3261a49fbdce0dad1.tar.gz
MFC r256645.
Add a new capability, VM_CAP_ENABLE_INVPCID, that can be enabled to expose 'invpcid' instruction to the guest. Currently bhyve will try to enable this capability unconditionally if it is available. Consolidate code in bhyve to set the capabilities so it is no longer duplicated in BSP and AP bringup. Add a sysctl 'vm.pmap.invpcid_works' to display whether the 'invpcid' instruction is available. Approved by: re (hrs)
Diffstat (limited to 'usr.sbin/bhyve/spinup_ap.c')
-rw-r--r--usr.sbin/bhyve/spinup_ap.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/usr.sbin/bhyve/spinup_ap.c b/usr.sbin/bhyve/spinup_ap.c
index 2632aed..729108a 100644
--- a/usr.sbin/bhyve/spinup_ap.c
+++ b/usr.sbin/bhyve/spinup_ap.c
@@ -85,22 +85,7 @@ spinup_ap(struct vmctx *ctx, int vcpu, int newcpu, uint64_t rip)
error = vcpu_reset(ctx, newcpu);
assert(error == 0);
- /* Set up capabilities */
- if (fbsdrun_vmexit_on_hlt()) {
- error = vm_set_capability(ctx, newcpu, VM_CAP_HALT_EXIT, 1);
- assert(error == 0);
- }
-
- if (fbsdrun_vmexit_on_pause()) {
- error = vm_set_capability(ctx, newcpu, VM_CAP_PAUSE_EXIT, 1);
- assert(error == 0);
- }
-
- if (fbsdrun_disable_x2apic())
- error = vm_set_x2apic_state(ctx, newcpu, X2APIC_DISABLED);
- else
- error = vm_set_x2apic_state(ctx, newcpu, X2APIC_ENABLED);
- assert(error == 0);
+ fbsdrun_set_capabilities(ctx, newcpu);
/*
* Enable the 'unrestricted guest' mode for 'newcpu'.
OpenPOWER on IntegriCloud