cpu_fxsr = hw_instruction_sse = 1;
}
+ if (cpu_vendor_id == CPU_VENDOR_AMD) {
+ switch((cpu_id & 0xFF0000)) {
+ case 0x100000:
+ case 0x120000:
+ /*
+ * Errata 721 is the cpu bug found by your's truly
+ * (Matthew Dillon). It is a bug where a sequence
+ * of 5 or more popq's + a retq, under involved
+ * deep recursion circumstances, can cause the %rsp
+ * to not be properly updated, almost always
+ * resulting in a seg-fault soon after.
+ */
+ msr = rdmsr(0xc0011029);
+ if ((msr & 1) == 0) {
+ kprintf("Errata 721 workaround installed\n");
+ msr |= 1;
+ wrmsr(0xc0011029, msr);
+ }
+ break;
+ }
+ }
+
if ((amd_feature & AMDID_NX) != 0) {
msr = rdmsr(MSR_EFER) | EFER_NXE;
wrmsr(MSR_EFER, msr);