Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86 Increase MTRR_I686_NVAR_MAX from 8 to 16. Avoids



details:   https://anonhg.NetBSD.org/src/rev/e80e0d5ca124
branches:  trunk
changeset: 772044:e80e0d5ca124
user:      abs <abs%NetBSD.org@localhost>
date:      Thu Dec 15 09:38:21 2011 +0000

description:
Increase MTRR_I686_NVAR_MAX from 8 to 16. Avoids
"FIXME: more than 8 MTRRs (10)" message on booting Thinkpad W520 and
similar. While here replace a magic number with MTRR_I686_NVAR_MAX * 2

diffstat:

 sys/arch/x86/include/mtrr.h       |   4 ++--
 sys/arch/x86/include/specialreg.h |  18 +++++++++++++++++-
 sys/arch/x86/x86/mtrr_i686.c      |  24 ++++++++++++++++++++----
 3 files changed, 39 insertions(+), 7 deletions(-)

diffs (102 lines):

diff -r bcd20bc1cf19 -r e80e0d5ca124 sys/arch/x86/include/mtrr.h
--- a/sys/arch/x86/include/mtrr.h       Thu Dec 15 08:36:05 2011 +0000
+++ b/sys/arch/x86/include/mtrr.h       Thu Dec 15 09:38:21 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mtrr.h,v 1.4 2008/07/01 15:27:34 mrg Exp $ */
+/* $NetBSD: mtrr.h,v 1.5 2011/12/15 09:38:21 abs Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #define MTRR_I686_FIXED_IDX16K 1
 #define MTRR_I686_FIXED_IDX4K  3
 
-#define MTRR_I686_NVAR_MAX     8       /* could be upto 255? */
+#define MTRR_I686_NVAR_MAX     16      /* could be upto 255? */
 
 #define MTRR_I686_64K_START            0x00000
 #define MTRR_I686_16K_START            0x80000
diff -r bcd20bc1cf19 -r e80e0d5ca124 sys/arch/x86/include/specialreg.h
--- a/sys/arch/x86/include/specialreg.h Thu Dec 15 08:36:05 2011 +0000
+++ b/sys/arch/x86/include/specialreg.h Thu Dec 15 09:38:21 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: specialreg.h,v 1.54 2011/12/09 10:08:47 cegger Exp $   */
+/*     $NetBSD: specialreg.h,v 1.55 2011/12/15 09:38:21 abs Exp $      */
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -381,6 +381,22 @@
 #define        MSR_MTRRphysMask6       0x20d
 #define        MSR_MTRRphysBase7       0x20e
 #define        MSR_MTRRphysMask7       0x20f
+#define        MSR_MTRRphysBase8       0x210
+#define        MSR_MTRRphysMask8       0x211
+#define        MSR_MTRRphysBase9       0x212
+#define        MSR_MTRRphysMask9       0x213
+#define        MSR_MTRRphysBase10      0x214
+#define        MSR_MTRRphysMask10      0x215
+#define        MSR_MTRRphysBase11      0x216
+#define        MSR_MTRRphysMask11      0x217
+#define        MSR_MTRRphysBase12      0x218
+#define        MSR_MTRRphysMask12      0x219
+#define        MSR_MTRRphysBase13      0x21a
+#define        MSR_MTRRphysMask13      0x21b
+#define        MSR_MTRRphysBase14      0x21c
+#define        MSR_MTRRphysMask14      0x21d
+#define        MSR_MTRRphysBase15      0x21e
+#define        MSR_MTRRphysMask15      0x21f
 #define        MSR_MTRRfix64K_00000    0x250
 #define        MSR_MTRRfix16K_80000    0x258
 #define        MSR_MTRRfix16K_A0000    0x259
diff -r bcd20bc1cf19 -r e80e0d5ca124 sys/arch/x86/x86/mtrr_i686.c
--- a/sys/arch/x86/x86/mtrr_i686.c      Thu Dec 15 08:36:05 2011 +0000
+++ b/sys/arch/x86/x86/mtrr_i686.c      Thu Dec 15 09:38:21 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mtrr_i686.c,v 1.24 2011/01/18 17:44:15 jmcneill Exp $ */
+/*     $NetBSD: mtrr_i686.c,v 1.25 2011/12/15 09:38:21 abs Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mtrr_i686.c,v 1.24 2011/01/18 17:44:15 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mtrr_i686.c,v 1.25 2011/12/15 09:38:21 abs Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -83,6 +83,22 @@
        { MSR_MTRRphysMask6, 0 },
        { MSR_MTRRphysBase7, 0 },
        { MSR_MTRRphysMask7, 0 },
+       { MSR_MTRRphysBase8, 0 },
+       { MSR_MTRRphysMask8, 0 },
+       { MSR_MTRRphysBase9, 0 },
+       { MSR_MTRRphysMask9, 0 },
+       { MSR_MTRRphysBase10, 0 },
+       { MSR_MTRRphysMask10, 0 },
+       { MSR_MTRRphysBase11, 0 },
+       { MSR_MTRRphysMask11, 0 },
+       { MSR_MTRRphysBase12, 0 },
+       { MSR_MTRRphysMask12, 0 },
+       { MSR_MTRRphysBase13, 0 },
+       { MSR_MTRRphysMask13, 0 },
+       { MSR_MTRRphysBase14, 0 },
+       { MSR_MTRRphysMask14, 0 },
+       { MSR_MTRRphysBase15, 0 },
+       { MSR_MTRRphysMask15, 0 },
        { MSR_MTRRfix64K_00000, 0 },
        { MSR_MTRRfix16K_80000, 0 },
        { MSR_MTRRfix16K_A0000, 0 },
@@ -305,8 +321,8 @@
                    MTRR_I686_NVAR_MAX, i686_mtrr_vcnt);
        else if (i686_mtrr_vcnt < MTRR_I686_NVAR_MAX) {
                for (i = MTRR_I686_NVAR_MAX - i686_mtrr_vcnt; i; i--) {
-                       mtrr_raw[16 - (i*2)].msraddr = 0;
-                       mtrr_raw[17 - (i*2)].msraddr = 0;
+                       mtrr_raw[(MTRR_I686_NVAR_MAX - i) * 2].msraddr = 0;
+                       mtrr_raw[(MTRR_I686_NVAR_MAX - i) * 2 + 1].msraddr = 0;
                }
        }
 



Home | Main Index | Thread Index | Old Index