]> nv-tegra.nvidia Code Review - linux-3.10.git/commitdiff
[PATCH] x86_64-always-use-cpuid-80000008-to-figure-out-mtrr fix
authorSiddha, Suresh B <suresh.b.siddha@intel.com>
Sat, 16 Apr 2005 22:25:11 +0000 (15:25 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 16 Apr 2005 22:25:11 +0000 (15:25 -0700)
We need to use the size_and_mask in set_mtrr_var_ranges(which is called
while programming MTRR's for AP's

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
arch/i386/kernel/cpu/mtrr/generic.c

index a4cce454d09b291920db801b3661890678f4bcb8..9f7a7ea6388dbf84f28be95b73484d63c38e243a 100644 (file)
@@ -193,7 +193,8 @@ static int set_mtrr_var_ranges(unsigned int index, struct mtrr_var_range *vr)
 
        rdmsr(MTRRphysBase_MSR(index), lo, hi);
        if ((vr->base_lo & 0xfffff0ffUL) != (lo & 0xfffff0ffUL)
 
        rdmsr(MTRRphysBase_MSR(index), lo, hi);
        if ((vr->base_lo & 0xfffff0ffUL) != (lo & 0xfffff0ffUL)
-           || (vr->base_hi & 0xfUL) != (hi & 0xfUL)) {
+           || (vr->base_hi & (size_and_mask >> (32 - PAGE_SHIFT))) !=
+               (hi & (size_and_mask >> (32 - PAGE_SHIFT)))) {
                mtrr_wrmsr(MTRRphysBase_MSR(index), vr->base_lo, vr->base_hi);
                changed = TRUE;
        }
                mtrr_wrmsr(MTRRphysBase_MSR(index), vr->base_lo, vr->base_hi);
                changed = TRUE;
        }
@@ -201,7 +202,8 @@ static int set_mtrr_var_ranges(unsigned int index, struct mtrr_var_range *vr)
        rdmsr(MTRRphysMask_MSR(index), lo, hi);
 
        if ((vr->mask_lo & 0xfffff800UL) != (lo & 0xfffff800UL)
        rdmsr(MTRRphysMask_MSR(index), lo, hi);
 
        if ((vr->mask_lo & 0xfffff800UL) != (lo & 0xfffff800UL)
-           || (vr->mask_hi & 0xfUL) != (hi & 0xfUL)) {
+           || (vr->mask_hi & (size_and_mask >> (32 - PAGE_SHIFT))) !=
+               (hi & (size_and_mask >> (32 - PAGE_SHIFT)))) {
                mtrr_wrmsr(MTRRphysMask_MSR(index), vr->mask_lo, vr->mask_hi);
                changed = TRUE;
        }
                mtrr_wrmsr(MTRRphysMask_MSR(index), vr->mask_lo, vr->mask_hi);
                changed = TRUE;
        }