Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Sep 2016 14:24:29 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r305539 - head/sys/amd64/amd64
Message-ID:  <201609071424.u87EOToA020864@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Wed Sep  7 14:24:29 2016
New Revision: 305539
URL: https://svnweb.freebsd.org/changeset/base/305539

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

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

Modified: head/sys/amd64/amd64/initcpu.c
==============================================================================
--- head/sys/amd64/amd64/initcpu.c	Wed Sep  7 14:01:58 2016	(r305538)
+++ head/sys/amd64/amd64/initcpu.c	Wed Sep  7 14:24:29 2016	(r305539)
@@ -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);
+		}
+	}
 }
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201609071424.u87EOToA020864>