summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorgrehan <grehan@FreeBSD.org>2013-01-25 21:38:31 +0000
committergrehan <grehan@FreeBSD.org>2013-01-25 21:38:31 +0000
commit94554367a02e21be52d85147b7190cad036ebd31 (patch)
treee0ad84ab96c9173dba6a2b562cb86e03507f22f4 /sys/amd64
parent502e79cf50725bcb8374d341f728c058c200b758 (diff)
downloadFreeBSD-src-94554367a02e21be52d85147b7190cad036ebd31.zip
FreeBSD-src-94554367a02e21be52d85147b7190cad036ebd31.tar.gz
Always allow access to the sysenter cs/esp/eip MSRs since they
are automatically saved and restored in the VMCS. Reviewed by: neel Obtained from: NetApp
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/vmm/intel/vmx.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c
index 4f267bb..287ac8c 100644
--- a/sys/amd64/vmm/intel/vmx.c
+++ b/sys/amd64/vmm/intel/vmx.c
@@ -696,6 +696,10 @@ vmx_vminit(struct vm *vm)
* vm-exit and vm-entry respectively. The host FSBASE and GSBASE are
* always restored from the vmcs host state area on vm-exit.
*
+ * The SYSENTER_CS/ESP/EIP MSRs are identical to FS/GSBASE in
+ * how they are saved/restored so can be directly accessed by the
+ * guest.
+ *
* Guest KGSBASE is saved and restored in the guest MSR save area.
* Host KGSBASE is restored before returning to userland from the pcb.
* There will be a window of time when we are executing in the host
@@ -708,6 +712,9 @@ vmx_vminit(struct vm *vm)
*/
if (guest_msr_rw(vmx, MSR_GSBASE) ||
guest_msr_rw(vmx, MSR_FSBASE) ||
+ guest_msr_rw(vmx, MSR_SYSENTER_CS_MSR) ||
+ guest_msr_rw(vmx, MSR_SYSENTER_ESP_MSR) ||
+ guest_msr_rw(vmx, MSR_SYSENTER_EIP_MSR) ||
guest_msr_rw(vmx, MSR_KGSBASE) ||
guest_msr_rw(vmx, MSR_EFER))
panic("vmx_vminit: error setting guest msr access");
OpenPOWER on IntegriCloud