aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2016-04-28 08:29:57 +0000
committerAndriy Gapon <avg@FreeBSD.org>2016-04-28 08:29:57 +0000
commite5e4452078986a8597845e41ead6edefdb1cda21 (patch)
tree61a66897b1d876de45e22aba2242568c9f02255f /sys/amd64
parent341134426f3e73c0cae3565a4abbac9869075ca6 (diff)
Notes
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/initcpu.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/amd64/amd64/initcpu.c b/sys/amd64/amd64/initcpu.c
index 15d817140437..bfc94b6a5180 100644
--- a/sys/amd64/amd64/initcpu.c
+++ b/sys/amd64/amd64/initcpu.c
@@ -80,6 +80,19 @@ init_amd(void)
wrmsr(0xc0011029, rdmsr(0xc0011029) | 1);
break;
}
+
+ /*
+ * BIOS may fail to set InitApicIdCpuIdLo to 1 as it should per BKDG.
+ * So, do it here or otherwise some tools could be confused by
+ * Initial Local APIC ID reported with CPUID Function 1 in EBX.
+ */
+ if (CPUID_TO_FAMILY(cpu_id) == 0x10) {
+ if ((cpu_feature2 & CPUID2_HV) == 0) {
+ msr = rdmsr(MSR_NB_CFG1);
+ msr |= (uint64_t)1 << 54;
+ wrmsr(MSR_NB_CFG1, msr);
+ }
+ }
}
/*