aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/cpu/mtrr/generic.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/i386/kernel/cpu/mtrr/generic.c')
-rw-r--r--arch/i386/kernel/cpu/mtrr/generic.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/i386/kernel/cpu/mtrr/generic.c b/arch/i386/kernel/cpu/mtrr/generic.c
index a4cce454d09b..9f7a7ea6388d 100644
--- a/arch/i386/kernel/cpu/mtrr/generic.c
+++ b/arch/i386/kernel/cpu/mtrr/generic.c
@@ -193,7 +193,8 @@ static int set_mtrr_var_ranges(unsigned int index, struct mtrr_var_range *vr)
193 193
194 rdmsr(MTRRphysBase_MSR(index), lo, hi); 194 rdmsr(MTRRphysBase_MSR(index), lo, hi);
195 if ((vr->base_lo & 0xfffff0ffUL) != (lo & 0xfffff0ffUL) 195 if ((vr->base_lo & 0xfffff0ffUL) != (lo & 0xfffff0ffUL)
196 || (vr->base_hi & 0xfUL) != (hi & 0xfUL)) { 196 || (vr->base_hi & (size_and_mask >> (32 - PAGE_SHIFT))) !=
197 (hi & (size_and_mask >> (32 - PAGE_SHIFT)))) {
197 mtrr_wrmsr(MTRRphysBase_MSR(index), vr->base_lo, vr->base_hi); 198 mtrr_wrmsr(MTRRphysBase_MSR(index), vr->base_lo, vr->base_hi);
198 changed = TRUE; 199 changed = TRUE;
199 } 200 }
@@ -201,7 +202,8 @@ static int set_mtrr_var_ranges(unsigned int index, struct mtrr_var_range *vr)
201 rdmsr(MTRRphysMask_MSR(index), lo, hi); 202 rdmsr(MTRRphysMask_MSR(index), lo, hi);
202 203
203 if ((vr->mask_lo & 0xfffff800UL) != (lo & 0xfffff800UL) 204 if ((vr->mask_lo & 0xfffff800UL) != (lo & 0xfffff800UL)
204 || (vr->mask_hi & 0xfUL) != (hi & 0xfUL)) { 205 || (vr->mask_hi & (size_and_mask >> (32 - PAGE_SHIFT))) !=
206 (hi & (size_and_mask >> (32 - PAGE_SHIFT)))) {
205 mtrr_wrmsr(MTRRphysMask_MSR(index), vr->mask_lo, vr->mask_hi); 207 mtrr_wrmsr(MTRRphysMask_MSR(index), vr->mask_lo, vr->mask_hi);
206 changed = TRUE; 208 changed = TRUE;
207 } 209 }