Author: kib
Date: Tue Aug  7 08:36:10 2012
New Revision: 239125
URL: http://svn.freebsd.org/changeset/base/239125

Log:
  Do not apply errata 721 workaround when under hypervisor, since
  typical hypervisor does not implement access to the required MSR,
  causing #GP on boot.
  
  Reported and tested by:       olgeni
  PR:   amd64/170388
  MFC after:    3 days

Modified:
  head/sys/amd64/amd64/initcpu.c

Modified: head/sys/amd64/amd64/initcpu.c
==============================================================================
--- head/sys/amd64/amd64/initcpu.c      Tue Aug  7 07:52:25 2012        
(r239124)
+++ head/sys/amd64/amd64/initcpu.c      Tue Aug  7 08:36:10 2012        
(r239125)
@@ -91,11 +91,17 @@ init_amd(void)
         *
         * http://support.amd.com/us/Processor_TechDocs/41322_10h_Rev_Gd.pdf
         * http://support.amd.com/us/Processor_TechDocs/44739_12h_Rev_Gd.pdf
+        *
+        * Hypervisors do not provide access to the errata MSR,
+        * causing #GP exception on attempt to apply the errata.  The
+        * MSR write shall be done on host and persist globally
+        * anyway, so do not try to do it when under virtualization.
         */
        switch (CPUID_TO_FAMILY(cpu_id)) {
        case 0x10:
        case 0x12:
-               wrmsr(0xc0011029, rdmsr(0xc0011029) | 1);
+               if ((cpu_feature2 & CPUID2_HV) == 0)
+                       wrmsr(0xc0011029, rdmsr(0xc0011029) | 1);
                break;
        }
 }
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to