+ x86-fix-dubious-segment-register-clear-in-cpu_init.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     x86: fix dubious segment register clear in cpu_init()

has been added to the -mm tree.  Its filename is

     x86-fix-dubious-segment-register-clear-in-cpu_init.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: x86: fix dubious segment register clear in cpu_init()
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>

Fix a very dubious piece of code in
arch/i386/kernel/cpu/common.c:cpu_init().  This clears out %fs and %gs, but
clobbers %eax in the process without telling gcc.  It turns out that gcc
happens to be not using %eax at that point anyway so it doesn't matter
much, but it looks like a bomb waiting to go off.

This does end up saving an instruction, because gcc wants %eax==0 for the
set_debugreg()s below.

Signed-off-by: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Cc: Zachary Amsden <zach@xxxxxxxxxx>
Cc: Andi Kleen <ak@xxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 arch/i386/kernel/cpu/common.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN arch/i386/kernel/cpu/common.c~x86-fix-dubious-segment-register-clear-in-cpu_init arch/i386/kernel/cpu/common.c
--- a/arch/i386/kernel/cpu/common.c~x86-fix-dubious-segment-register-clear-in-cpu_init
+++ a/arch/i386/kernel/cpu/common.c
@@ -675,7 +675,7 @@ old_gdt:
 #endif
 
 	/* Clear %fs and %gs. */
-	asm volatile ("xorl %eax, %eax; movl %eax, %fs; movl %eax, %gs");
+	asm volatile ("movl %0, %%fs; movl %0, %%gs" : : "r" (0));
 
 	/* Clear all 6 debug registers: */
 	set_debugreg(0, 0);
_

Patches currently in -mm which might be from jeremy@xxxxxxxx are

git-cpufreq.patch
x86-fix-dubious-segment-register-clear-in-cpu_init.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux