summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2003-11-22 01:11:07 +0000
committerpeter <peter@FreeBSD.org>2003-11-22 01:11:07 +0000
commit5d06137397cc0869db52c0ca96423fe73cd0fae0 (patch)
treea2874ad8c980e241e92be4babe479a720531a302 /sys
parent75a8ab1efd9c3919ca3e70304a850b5774766e95 (diff)
downloadFreeBSD-src-5d06137397cc0869db52c0ca96423fe73cd0fae0.zip
FreeBSD-src-5d06137397cc0869db52c0ca96423fe73cd0fae0.tar.gz
Argh! The Athlon64 and Opteron only implement 40 bits of address space in
the MTRR Base/Mask registers. If you use the documented algorithm in the systems programming guide, you'll get a GPF. The only thing that has prevented this so far is that the bios pre-sets some MTRR entries which we mis-interpreted sufficiently to fool the memcontrol interface into thinking all the address space was taken and therefore rejected XFree86's requests. However, not all bioses do this.. You get an insta-panic in that case. Grrr. A better fix (dynamic mask) will happen by 5.3/5-stable so that we automatically adapt to more than 40 physical bits. Approved by: re (scottl)
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/amd64_mem.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/amd64/amd64/amd64_mem.c b/sys/amd64/amd64/amd64_mem.c
index 84b5707..f4a12e9 100644
--- a/sys/amd64/amd64/amd64_mem.c
+++ b/sys/amd64/amd64/amd64_mem.c
@@ -214,13 +214,13 @@ amd64_mrfetch(struct mem_range_softc *sc)
msrv = rdmsr(msr);
mrd->mr_flags = (mrd->mr_flags & ~MDF_ATTRMASK) |
amd64_mtrr2mrt(msrv & 0xff);
- mrd->mr_base = msrv & 0x000ffffffffff000L;
+ mrd->mr_base = msrv & 0x000000fffffff000L;
msrv = rdmsr(msr + 1);
mrd->mr_flags = (msrv & 0x800) ?
(mrd->mr_flags | MDF_ACTIVE) :
(mrd->mr_flags & ~MDF_ACTIVE);
/* Compute the range from the mask. Ick. */
- mrd->mr_len = (~(msrv & 0x000ffffffffff000L) & 0x000fffffffffffffL) + 1;
+ mrd->mr_len = (~(msrv & 0x000000fffffff000L) & 0x000000ffffffffffL) + 1;
if (!mrvalid(mrd->mr_base, mrd->mr_len))
mrd->mr_flags |= MDF_BOGUS;
/* If unclaimed and active, must be the BIOS */
@@ -348,7 +348,7 @@ amd64_mrstoreone(void *arg)
/* base/type register */
omsrv = rdmsr(msr);
if (mrd->mr_flags & MDF_ACTIVE) {
- msrv = mrd->mr_base & 0x000ffffffffff000L;
+ msrv = mrd->mr_base & 0x000000fffffff000L;
msrv |= amd64_mrt2mtrr(mrd->mr_flags, omsrv);
} else {
msrv = 0;
@@ -357,7 +357,7 @@ amd64_mrstoreone(void *arg)
/* mask/active register */
if (mrd->mr_flags & MDF_ACTIVE) {
- msrv = 0x800 | (~(mrd->mr_len - 1) & 0x000ffffffffff000L);
+ msrv = 0x800 | (~(mrd->mr_len - 1) & 0x000000fffffff000L);
} else {
msrv = 0;
}
@@ -553,7 +553,6 @@ amd64_mrinit(struct mem_range_softc *sc)
return;
}
nmdesc = mtrrcap & 0xff;
- printf("Pentium Pro MTRR support enabled\n");
/* If fixed MTRRs supported and enabled */
if ((mtrrcap & 0x100) && (mtrrdef & 0x400)) {
OpenPOWER on IntegriCloud