diff options
author | Borislav Petkov <bp@suse.de> | 2013-02-11 09:22:17 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2013-02-12 18:48:42 -0500 |
commit | c3a22a26d07d928e2b74b58e2f9d2436958620f0 (patch) | |
tree | 9587a420b765651c13765311ee97ba0bcc753104 /arch | |
parent | 9efb58de919efa8312861d454be014094f6f0ffc (diff) |
x86, head_32: Remove second CPUID detection from default_entry
We do that once earlier now and cache it into new_cpu_data.cpuid_level
so no need for the EFLAGS.ID toggling dance anymore.
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: http://lkml.kernel.org/r/1360592538-10643-4-git-send-email-bp@alien8.de
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/head_32.S | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S index e3725a0f4327..2e8532e7c80a 100644 --- a/arch/x86/kernel/head_32.S +++ b/arch/x86/kernel/head_32.S | |||
@@ -399,18 +399,7 @@ default_entry: | |||
399 | /* | 399 | /* |
400 | * Check if it is 486 | 400 | * Check if it is 486 |
401 | */ | 401 | */ |
402 | movl $-1,X86_CPUID # -1 for no CPUID initially | 402 | cmpl $-1,X86_CPUID |
403 | movb $4,X86 # at least 486 | ||
404 | pushfl # push EFLAGS | ||
405 | popl %eax # get EFLAGS | ||
406 | movl %eax,%ecx # save original EFLAGS | ||
407 | xorl $0x200000,%eax # flip ID bit in EFLAGS | ||
408 | pushl %eax # copy to EFLAGS | ||
409 | popfl # set EFLAGS | ||
410 | pushfl # get new EFLAGS | ||
411 | popl %eax # put it in eax | ||
412 | xorl %ecx,%eax # change in flags | ||
413 | testl $0x200000,%eax # check if ID bit changed | ||
414 | je is486 | 403 | je is486 |
415 | 404 | ||
416 | /* get vendor info */ | 405 | /* get vendor info */ |
@@ -436,7 +425,9 @@ default_entry: | |||
436 | movb %cl,X86_MASK | 425 | movb %cl,X86_MASK |
437 | movl %edx,X86_CAPABILITY | 426 | movl %edx,X86_CAPABILITY |
438 | 427 | ||
439 | is486: movl $0x50022,%ecx # set AM, WP, NE and MP | 428 | is486: |
429 | movb $4,X86 | ||
430 | movl $0x50022,%ecx # set AM, WP, NE and MP | ||
440 | movl %cr0,%eax | 431 | movl %cr0,%eax |
441 | andl $0x80000011,%eax # Save PG,PE,ET | 432 | andl $0x80000011,%eax # Save PG,PE,ET |
442 | orl %ecx,%eax | 433 | orl %ecx,%eax |