svn commit: r307997 - stable/11/sys/amd64/amd64

Andriy Gapon avg at FreeBSD.org
Thu Oct 27 07:57:26 UTC 2016


Author: avg
Date: Thu Oct 27 07:57:25 2016
New Revision: 307997
URL: https://svnweb.freebsd.org/changeset/base/307997

Log:
  MFC r305539: work around AMD erratum 793 for family 16h, models 00h-0Fh

Modified:
  stable/11/sys/amd64/amd64/initcpu.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/amd64/amd64/initcpu.c
==============================================================================
--- stable/11/sys/amd64/amd64/initcpu.c	Thu Oct 27 07:54:10 2016	(r307996)
+++ stable/11/sys/amd64/amd64/initcpu.c	Thu Oct 27 07:57:25 2016	(r307997)
@@ -108,6 +108,20 @@ init_amd(void)
 			wrmsr(0xc001102a, msr);
 		}
 	}
+
+	/*
+	 * Work around Erratum 793: Specific Combination of Writes to Write
+	 * Combined Memory Types and Locked Instructions May Cause Core Hang.
+	 * See Revision Guide for AMD Family 16h Models 00h-0Fh Processors,
+	 * revision 3.04 or later, publication 51810.
+	 */
+	if (CPUID_TO_FAMILY(cpu_id) == 0x16 && CPUID_TO_MODEL(cpu_id) <= 0xf) {
+		if ((cpu_feature2 & CPUID2_HV) == 0) {
+			msr = rdmsr(0xc0011020);
+			msr |= (uint64_t)1 << 15;
+			wrmsr(0xc0011020, msr);
+		}
+	}
 }
 
 /*


More information about the svn-src-all mailing list