svn commit: r267217 - projects/bhyve_svm/sys/amd64/vmm/amd
Peter Grehan
grehan at FreeBSD.org
Sat Jun 7 23:05:13 UTC 2014
Author: grehan
Date: Sat Jun 7 23:05:12 2014
New Revision: 267217
URL: http://svnweb.freebsd.org/changeset/base/267217
Log:
Set the guest PAT MSR in the VMCB to power-on defaults.
Linux guests accept the values in this register, while *BSD
guests reprogram it. Default values of zero correspond to
PAT_UNCACHEABLE, resulting in glacial performance.
Thanks to Willem Jan Withagen for first reporting this and
helping out with the investigation.
Modified:
projects/bhyve_svm/sys/amd64/vmm/amd/vmcb.c
Modified: projects/bhyve_svm/sys/amd64/vmm/amd/vmcb.c
==============================================================================
--- projects/bhyve_svm/sys/amd64/vmm/amd/vmcb.c Sat Jun 7 21:36:52 2014 (r267216)
+++ projects/bhyve_svm/sys/amd64/vmm/amd/vmcb.c Sat Jun 7 23:05:12 2014 (r267217)
@@ -67,10 +67,20 @@ svm_init_vmcb(struct vmcb *vmcb, uint64_
/* Enable nested paging */
ctrl->np_enable = 1;
ctrl->n_cr3 = np_pml4;
-
+
/* EFER_SVM must always be set when the guest is executing */
state->efer = EFER_SVM;
-
+
+ /* Set up the PAT to power-on state */
+ state->g_pat = PAT_VALUE(0, PAT_WRITE_BACK) |
+ PAT_VALUE(1, PAT_WRITE_THROUGH) |
+ PAT_VALUE(2, PAT_UNCACHED) |
+ PAT_VALUE(3, PAT_UNCACHEABLE) |
+ PAT_VALUE(4, PAT_WRITE_BACK) |
+ PAT_VALUE(5, PAT_WRITE_THROUGH) |
+ PAT_VALUE(6, PAT_UNCACHED) |
+ PAT_VALUE(7, PAT_UNCACHEABLE);
+
return (0);
}
More information about the svn-src-projects
mailing list