Module Name: src
Committed By: riz
Date: Mon Apr 9 18:02:25 UTC 2012
Modified Files:
src/sys/arch/x86/include [netbsd-6]: specialreg.h
src/sys/arch/x86/x86 [netbsd-6]: errata.c
Log Message:
Pull up following revision(s) (requested by chs in ticket #168):
sys/arch/x86/include/specialreg.h: revision 1.57
sys/arch/x86/x86/errata.c: revision 1.20
bring in this change from openbsd:
Implement the AMD suggested workaround for family 10h & 12h errata 721
"Processor May Incorrectly Update Stack Pointer" by setting a bit
marked 'reserved' in an MSR that is only "documented" to exist on 12h.
To generate a diff of this commit:
cvs rdiff -u -r1.55.2.1 -r1.55.2.2 src/sys/arch/x86/include/specialreg.h
cvs rdiff -u -r1.19 -r1.19.14.1 src/sys/arch/x86/x86/errata.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/x86/include/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.55.2.1 src/sys/arch/x86/include/specialreg.h:1.55.2.2
--- src/sys/arch/x86/include/specialreg.h:1.55.2.1 Mon Mar 5 20:18:03 2012
+++ src/sys/arch/x86/include/specialreg.h Mon Apr 9 18:02:24 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: specialreg.h,v 1.55.2.1 2012/03/05 20:18:03 sborrill Exp $ */
+/* $NetBSD: specialreg.h,v 1.55.2.2 2012/04/09 18:02:24 riz Exp $ */
/*-
* Copyright (c) 1991 The Regents of the University of California.
@@ -516,6 +516,9 @@
#define BU_CFG_WBPFSMCCHKDIS 0x0000200000000000ULL
#define BU_CFG_WBENHWSBDIS 0x0001000000000000ULL
+#define MSR_DE_CFG 0xc0011029
+#define DE_CFG_ERRATA_721 0x00000001
+
/* AMD Family10h MSRs */
#define MSR_OSVW_ID_LENGTH 0xc0010140
#define MSR_OSVW_STATUS 0xc0010141
Index: src/sys/arch/x86/x86/errata.c
diff -u src/sys/arch/x86/x86/errata.c:1.19 src/sys/arch/x86/x86/errata.c:1.19.14.1
--- src/sys/arch/x86/x86/errata.c:1.19 Fri Jul 23 22:31:35 2010
+++ src/sys/arch/x86/x86/errata.c Mon Apr 9 18:02:25 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: errata.c,v 1.19 2010/07/23 22:31:35 cegger Exp $ */
+/* $NetBSD: errata.c,v 1.19.14.1 2012/04/09 18:02:25 riz Exp $ */
/*-
* Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -45,7 +45,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: errata.c,v 1.19 2010/07/23 22:31:35 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: errata.c,v 1.19.14.1 2012/04/09 18:02:25 riz Exp $");
#include <sys/types.h>
#include <sys/systm.h>
@@ -69,7 +69,8 @@ typedef struct errata {
typedef enum cpurev {
BH_E4, CH_CG, CH_D0, DH_CG, DH_D0, DH_E3, DH_E6, JH_E1,
JH_E6, SH_B0, SH_B3, SH_C0, SH_CG, SH_D0, SH_E4, SH_E5,
- DR_BA, DR_B2, DR_B3,
+ DR_BA, DR_B2, DR_B3, RB_C2, RB_C3, BL_C2, BL_C3, DA_C2,
+ DA_C3, HY_D0, HY_D1, HY_D1_G34R1, PH_E0, LN_B0,
OINK
} cpurev_t;
@@ -85,6 +86,10 @@ static const u_int cpurevs[] = {
SH_D0, 0x0010f40, SH_D0, 0x0010f50, SH_D0, 0x0010f70,
SH_E4, 0x0020f51, SH_E4, 0x0020f71, SH_E5, 0x0020f42,
DR_BA, 0x0100f2a, DR_B2, 0x0100f22, DR_B3, 0x0100f23,
+ RB_C2, 0x0100f42, RB_C3, 0x0100f43, BL_C2, 0x0100f52,
+ BL_C3, 0x0100f53, DA_C2, 0x0100f62, DA_C3, 0x0100f63,
+ HY_D0, 0x0100f80, HY_D1, 0x0100f81, HY_D1_G34R1, 0x0100f91,
+ PH_E0, 0x0100fa0, LN_B0, 0x0300f10,
OINK
};
@@ -132,6 +137,11 @@ static const uint8_t x86_errata_set10[]
DR_BA, DR_B2, DR_B3, OINK
};
+static const uint8_t x86_errata_set11[] = {
+ DR_BA, DR_B2, DR_B3, RB_C2, RB_C3, BL_C2, BL_C3, DA_C2,
+ DA_C3, HY_D0, HY_D1, HY_D1_G34R1, PH_E0, LN_B0, OINK
+};
+
static bool x86_errata_setmsr(struct cpu_info *, errata_t *);
static bool x86_errata_testmsr(struct cpu_info *, errata_t *);
@@ -268,6 +278,13 @@ static errata_t errata[] = {
309, FALSE, MSR_BU_CFG, x86_errata_set9,
x86_errata_testmsr, BU_CFG_ERRATA_309
},
+ /*
+ * 721: Processor May Incorrectly Update Stack Pointer
+ */
+ {
+ 721, FALSE, MSR_DE_CFG, x86_errata_set11,
+ x86_errata_setmsr, DE_CFG_ERRATA_721
+ },
};
static bool