aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/relocate_kernel_32.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/relocate_kernel_32.S')
-rw-r--r--arch/x86/kernel/relocate_kernel_32.S17
1 files changed, 9 insertions, 8 deletions
diff --git a/arch/x86/kernel/relocate_kernel_32.S b/arch/x86/kernel/relocate_kernel_32.S
index ce12bb8678ad..a7ecc8e0bc67 100644
--- a/arch/x86/kernel/relocate_kernel_32.S
+++ b/arch/x86/kernel/relocate_kernel_32.S
@@ -9,6 +9,7 @@
9#include <linux/linkage.h> 9#include <linux/linkage.h>
10#include <asm/page.h> 10#include <asm/page.h>
11#include <asm/kexec.h> 11#include <asm/kexec.h>
12#include <asm/processor-flags.h>
12 13
13/* 14/*
14 * Must be relocatable PIC code callable as a C function 15 * Must be relocatable PIC code callable as a C function
@@ -167,16 +168,16 @@ identity_mapped:
167 pushl %edx 168 pushl %edx
168 169
169 /* Set cr0 to a known state: 170 /* Set cr0 to a known state:
170 * 31 0 == Paging disabled 171 * - Paging disabled
171 * 18 0 == Alignment check disabled 172 * - Alignment check disabled
172 * 16 0 == Write protect disabled 173 * - Write protect disabled
173 * 3 0 == No task switch 174 * - No task switch
174 * 2 0 == Don't do FP software emulation. 175 * - Don't do FP software emulation.
175 * 0 1 == Proctected mode enabled 176 * - Proctected mode enabled
176 */ 177 */
177 movl %cr0, %eax 178 movl %cr0, %eax
178 andl $~((1<<31)|(1<<18)|(1<<16)|(1<<3)|(1<<2)), %eax 179 andl $~(X86_CR0_PG | X86_CR0_AM | X86_CR0_WP | X86_CR0_TS | X86_CR0_EM), %eax
179 orl $(1<<0), %eax 180 orl $(X86_CR0_PE), %eax
180 movl %eax, %cr0 181 movl %eax, %cr0
181 182
182 /* clear cr4 if applicable */ 183 /* clear cr4 if applicable */