Skip to contentSkip to conversation

x86: Fix override new_cpu_data.x86 with 486

PATCH In review Wang YanQing 3 participants 3 messages Jun 28, 2013 – Jul 5, 2013 x86

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 x86: Fix override new_cpu_data.x86 with 486

We should set X86 to 486 before use cpuid
to detect the cpu type, if we set X86 to 486
after cpuid, then we will get 486 until
cpu_detect runs.

---
ChangeLog
v1-v2:
1:Use more accurate and short commit log

 arch/x86/kernel/head_32.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/head_32.S +1 -1
index 73afd11..24c6675 100644
@@ -410,6 +410,7 @@ enable_paging:
 /*
  * Check if it is 486
  */
+	movb $4,X86			# at least 486
 	cmpl $-1,X86_CPUID
 	je is486
 
@@ -437,7 +438,6 @@ enable_paging:
 	movl %edx,X86_CAPABILITY
 
 is486:
-	movb $4,X86
 	movl $0x50022,%ecx	# set AM, WP, NE and MP
 	movl %cr0,%eax
 	andl $0x80000011,%eax	# Save PG,PE,ET
Signature · 1 line
1.7.12.4.dirty
maintainer Acked-by on v2 1/1
#1 lore raw
Quoted 6 lines · Wang YanQing

We should set X86 to 486 before use cpuid
to detect the cpu type, if we set X86 to 486
after cpuid, then we will get 486 until
cpu_detect runs.

Since this is not a critical bugfix but a mere correctness issue, and it is too late for 3.11 anyway, it is most likely going to go straight to 3.12.

Thanks.

Signature · 5 lines
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
#2 lore raw
In reply to Wang YanQing
x86: Fix override new_cpu_data.x86 with 486
Commit-ID:  237d1548543312fcc8c99d302ab68fbf8ef6f97f
Gitweb:     http://git.kernel.org/tip/237d1548543312fcc8c99d302ab68fbf8ef6f97f
Author:     Wang YanQing <[email protected]>
AuthorDate: Fri, 28 Jun 2013 22:45:16 +0800
Committer:  H. Peter Anvin <[email protected]>
CommitDate: Fri, 28 Jun 2013 15:27:29 -0700

x86: Fix override new_cpu_data.x86 with 486

We should set X86 to 486 before use cpuid to detect the cpu type, if we set X86 to 486 after cpuid, then we will get 486 until cpu_detect runs.

---
 arch/x86/kernel/head_32.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/head_32.S +1 -1
index e65ddc6..fe79573 100644
@@ -410,6 +410,7 @@ enable_paging:
 /*
  * Check if it is 486
  */
+	movb $4,X86			# at least 486
 	cmpl $-1,X86_CPUID
 	je is486
 
@@ -437,7 +438,6 @@ enable_paging:
 	movl %edx,X86_CAPABILITY
 
 is486:
-	movb $4,X86
 	movl $0x50022,%ecx	# set AM, WP, NE and MP
 	movl %cr0,%eax
 	andl $0x80000011,%eax	# Save PG,PE,ET