summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2016-10-27 07:57:43 +0000
committeravg <avg@FreeBSD.org>2016-10-27 07:57:43 +0000
commitaf9855ea99f4ab7d966317f717777f89e634a613 (patch)
tree700a8e9c83a04a0316bee07f2ffc7643e5a36c96 /sys/amd64
parentefc53708a7034feb92ee449b4286aacf0016dbe9 (diff)
downloadFreeBSD-src-af9855ea99f4ab7d966317f717777f89e634a613.zip
FreeBSD-src-af9855ea99f4ab7d966317f717777f89e634a613.tar.gz
MFC r305539: work around AMD erratum 793 for family 16h, models 00h-0Fh
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/initcpu.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/amd64/amd64/initcpu.c b/sys/amd64/amd64/initcpu.c
index e20a271..66e465e 100644
--- a/sys/amd64/amd64/initcpu.c
+++ b/sys/amd64/amd64/initcpu.c
@@ -139,6 +139,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);
+ }
+ }
}
/*
OpenPOWER on IntegriCloud