From: Brian Gerst Date: Mon, 21 May 2007 12:31:53 +0000 (+0200) Subject: i386: fix PGE mask X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=17304383ebc1ce68a88030ac4d18ea549d9578c7;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git i386: fix PGE mask cr4 is a 32-bit register, so casting the mask to an unsigned char is wrong, as it clears more than the PGE bit. Signed-off-by: Brian Gerst Signed-off-by: Andi Kleen Signed-off-by: Linus Torvalds --- diff --git a/arch/i386/kernel/cpu/mtrr/cyrix.c b/arch/i386/kernel/cpu/mtrr/cyrix.c index 0737a596db43..9edf5625584f 100644 --- a/arch/i386/kernel/cpu/mtrr/cyrix.c +++ b/arch/i386/kernel/cpu/mtrr/cyrix.c @@ -136,7 +136,7 @@ static void prepare_set(void) /* Save value of CR4 and clear Page Global Enable (bit 7) */ if ( cpu_has_pge ) { cr4 = read_cr4(); - write_cr4(cr4 & (unsigned char) ~(1 << 7)); + write_cr4(cr4 & ~X86_CR4_PGE); } /* Disable and flush caches. Note that wbinvd flushes the TLBs as diff --git a/arch/i386/kernel/cpu/mtrr/state.c b/arch/i386/kernel/cpu/mtrr/state.c index f62ecd15811a..7b39a2f954d9 100644 --- a/arch/i386/kernel/cpu/mtrr/state.c +++ b/arch/i386/kernel/cpu/mtrr/state.c @@ -19,7 +19,7 @@ void set_mtrr_prepare_save(struct set_mtrr_context *ctxt) /* Save value of CR4 and clear Page Global Enable (bit 7) */ if ( cpu_has_pge ) { ctxt->cr4val = read_cr4(); - write_cr4(ctxt->cr4val & (unsigned char) ~(1 << 7)); + write_cr4(ctxt->cr4val & ~X86_CR4_PGE); } /* Disable and flush caches. Note that wbinvd flushes the TLBs as