From d9a799683c22e8c1608169c13b2e9bbe738b83d5 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sun, 7 Nov 2010 21:48:49 +0000 Subject: [PATCH] Don't call pmap_demote_DMAP() on MTRR entries from the BIOS that are marked as "bogus". Reported by: Jia-Shiun Li --- sys/amd64/amd64/amd64_mem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/amd64/amd64/amd64_mem.c b/sys/amd64/amd64/amd64_mem.c index 0f7bc25ec720..2768cf428fe1 100644 --- a/sys/amd64/amd64/amd64_mem.c +++ b/sys/amd64/amd64/amd64_mem.c @@ -583,7 +583,7 @@ amd64_mrset(struct mem_range_softc *sc, struct mem_range_desc *mrd, int *arg) i = (sc->mr_cap & MR686_FIXMTRR) ? MTRR_N64K + MTRR_N16K + MTRR_N4K : 0; mrd = sc->mr_desc + i; for (; i < sc->mr_ndesc; i++, mrd++) { - if (mrd->mr_flags & MDF_ACTIVE) + if ((mrd->mr_flags & (MDF_ACTIVE | MDF_BOGUS)) == MDF_ACTIVE) pmap_demote_DMAP(mrd->mr_base, mrd->mr_len, FALSE); } @@ -688,7 +688,7 @@ amd64_mrinit(struct mem_range_softc *sc) i = (sc->mr_cap & MR686_FIXMTRR) ? MTRR_N64K + MTRR_N16K + MTRR_N4K : 0; mrd = sc->mr_desc + i; for (; i < sc->mr_ndesc; i++, mrd++) { - if (mrd->mr_flags & MDF_ACTIVE) + if ((mrd->mr_flags & (MDF_ACTIVE | MDF_BOGUS)) == MDF_ACTIVE) pmap_demote_DMAP(mrd->mr_base, mrd->mr_len, TRUE); } }