]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC 261638,262144,262506,266765:
authorjhb <jhb@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 12 Jun 2014 19:58:12 +0000 (19:58 +0000)
committerjhb <jhb@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 12 Jun 2014 19:58:12 +0000 (19:58 +0000)
commitc7a668d02efddca1808b103f95f83aae31f877b8
treea88a56bf8fd9c614d7ab81310cc3f2e44f3a1606
parent36fb486a552571f263327f3ba8bb04f808a6ab10
MFC 261638,262144,262506,266765:
Add virtualized XSAVE support to bhyve which permits guests to use XSAVE and
XSAVE-enabled features like AVX.
- Store a per-cpu guest xcr0 register and handle xsetbv VM exits by emulating
  the instruction.
- Only expose XSAVE to guests if XSAVE is enabled in the host.  Only expose
  a subset of XSAVE features currently supported by the guest and for which
  the proper emulation of xsetbv is known.  Currently this includes X87, SSE,
  AVX, AVX-512, and Intel MPX.
- Add support for injecting hardware exceptions into the guest and use this
  to trigger exceptions in the guest for invalid xsetbv operations instead
  of potentially faulting in the host.
- Queue pending exceptions in the 'struct vcpu' instead of directly updating
  the processor-specific VMCS or VMCB. The pending exception will be delivered
  right before entering the guest.
- Rename the unused ioctl VM_INJECT_EVENT to VM_INJECT_EXCEPTION and restrict
  it to only deliver x86 hardware exceptions. This new ioctl is now used to
  inject a protection fault when the guest accesses an unimplemented MSR.
- Expose a subset of known-safe features from leaf 0 of the structured
  extended features to guests if they are supported on the host including
  RDFSBASE/RDGSBASE, BMI1/2, AVX2, AVX-512, HLE, ERMS, and RTM.  Aside
  from AVX-512, these features are all new instructions available for use
  in ring 3 with no additional hypervisor changes needed.

git-svn-id: svn://svn.freebsd.org/base/stable/10@267427 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
13 files changed:
lib/libvmmapi/vmmapi.c
lib/libvmmapi/vmmapi.h
sys/amd64/include/vmm.h
sys/amd64/include/vmm_dev.h
sys/amd64/vmm/amd/amdv.c
sys/amd64/vmm/intel/vmcs.h
sys/amd64/vmm/intel/vmx.c
sys/amd64/vmm/vmm.c
sys/amd64/vmm/vmm_dev.c
sys/amd64/vmm/vmm_host.c
sys/amd64/vmm/vmm_host.h
sys/amd64/vmm/x86.c
usr.sbin/bhyve/bhyverun.c