public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2]x86: Fix override new_cpu_data.x86 with 486
@ 2013-06-28 14:45 Wang YanQing
  2013-06-28 14:57 ` Borislav Petkov
  2013-07-05 14:25 ` [tip:x86/cpu] x86: " tip-bot for Wang YanQing
  0 siblings, 2 replies; 3+ messages in thread
From: Wang YanQing @ 2013-06-28 14:45 UTC (permalink / raw)
  To: bp; +Cc: hpa, tglx, mingo, x86, bp, fenghua.yu, linux-kernel

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.

Signed-off-by: Wang YanQing <udknight@gmail.com>
---
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(-)

diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index 73afd11..24c6675 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -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
-- 
1.7.12.4.dirty

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2]x86: Fix override new_cpu_data.x86 with 486
  2013-06-28 14:45 [PATCH v2]x86: Fix override new_cpu_data.x86 with 486 Wang YanQing
@ 2013-06-28 14:57 ` Borislav Petkov
  2013-07-05 14:25 ` [tip:x86/cpu] x86: " tip-bot for Wang YanQing
  1 sibling, 0 replies; 3+ messages in thread
From: Borislav Petkov @ 2013-06-28 14:57 UTC (permalink / raw)
  To: Wang YanQing; +Cc: hpa, tglx, mingo, x86, bp, fenghua.yu, linux-kernel

On Fri, Jun 28, 2013 at 10:45:16PM +0800, Wang YanQing wrote:
> 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.
> 
> Signed-off-by: Wang YanQing <udknight@gmail.com>

Acked-by: Borislav Petkov <bp@suse.de>

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.

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:x86/cpu] x86: Fix override new_cpu_data.x86 with 486
  2013-06-28 14:45 [PATCH v2]x86: Fix override new_cpu_data.x86 with 486 Wang YanQing
  2013-06-28 14:57 ` Borislav Petkov
@ 2013-07-05 14:25 ` tip-bot for Wang YanQing
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Wang YanQing @ 2013-07-05 14:25 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, tglx, hpa, bp, udknight

Commit-ID:  237d1548543312fcc8c99d302ab68fbf8ef6f97f
Gitweb:     http://git.kernel.org/tip/237d1548543312fcc8c99d302ab68fbf8ef6f97f
Author:     Wang YanQing <udknight@gmail.com>
AuthorDate: Fri, 28 Jun 2013 22:45:16 +0800
Committer:  H. Peter Anvin <hpa@linux.intel.com>
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.

Signed-off-by: Wang YanQing <udknight@gmail.com>
Link: http://lkml.kernel.org/r/20130628144516.GA2177@udknight
Acked-by: Borislav Petkov <bp@suse.de>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 arch/x86/kernel/head_32.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index e65ddc6..fe79573 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-07-05 14:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-28 14:45 [PATCH v2]x86: Fix override new_cpu_data.x86 with 486 Wang YanQing
2013-06-28 14:57 ` Borislav Petkov
2013-07-05 14:25 ` [tip:x86/cpu] x86: " tip-bot for Wang YanQing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox