<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/x86/lib, branch linux-2.6.28.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.28.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.28.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2009-02-06T21:47:17Z</updated>
<entry>
<title>x86: use early clobbers in usercopy*.c</title>
<updated>2009-02-06T21:47:17Z</updated>
<author>
<name>Andi Kleen</name>
</author>
<published>2009-01-16T14:22:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=049ee5f967464ed93b6428eef7112c8ed1939acf'/>
<id>urn:sha1:049ee5f967464ed93b6428eef7112c8ed1939acf</id>
<content type='text'>
commit e0a96129db574d6365e3439d16d88517c437ab33 upstream.

Impact: fix rare (but currently harmless) miscompile with certain configs and gcc versions

Hugh Dickins noticed that strncpy_from_user() was miscompiled
in some circumstances with gcc 4.3.

Thanks to Hugh's excellent analysis it was easy to track down.

Hugh writes:

&gt; Try building an x86_64 defconfig 2.6.29-rc1 kernel tree,
&gt; except not quite defconfig, switch CONFIG_PREEMPT_NONE=y
&gt; and CONFIG_PREEMPT_VOLUNTARY off (because it expands a
&gt; might_fault() there, which hides the issue): using a
&gt; gcc 4.3.2 (I've checked both openSUSE 11.1 and Fedora 10).
&gt;
&gt; It generates the following:
&gt;
&gt; 0000000000000000 &lt;__strncpy_from_user&gt;:
&gt;    0:   48 89 d1                mov    %rdx,%rcx
&gt;    3:   48 85 c9                test   %rcx,%rcx
&gt;    6:   74 0e                   je     16 &lt;__strncpy_from_user+0x16&gt;
&gt;    8:   ac                      lods   %ds:(%rsi),%al
&gt;    9:   aa                      stos   %al,%es:(%rdi)
&gt;    a:   84 c0                   test   %al,%al
&gt;    c:   74 05                   je     13 &lt;__strncpy_from_user+0x13&gt;
&gt;    e:   48 ff c9                dec    %rcx
&gt;   11:   75 f5                   jne    8 &lt;__strncpy_from_user+0x8&gt;
&gt;   13:   48 29 c9                sub    %rcx,%rcx
&gt;   16:   48 89 c8                mov    %rcx,%rax
&gt;   19:   c3                      retq
&gt;
&gt; Observe that "sub %rcx,%rcx; mov %rcx,%rax", whereas gcc 4.2.1
&gt; (and many other configs) say "sub %rcx,%rdx; mov %rdx,%rax".
&gt; Isn't it returning 0 when it ought to be returning strlen?

The asm constraints for the strncpy_from_user() result were missing an
early clobber, which tells gcc that the last output arguments
are written before all input arguments are read.

Also add more early clobbers in the rest of the file and fix 32-bit
usercopy.c in the same way.

Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;
Signed-off-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
[ since this API is rarely used and no in-kernel user relies on a 'len'
  return value (they only rely on negative return values) this miscompile
  was never noticed in the field. But it's worth fixing it nevertheless. ]
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>Merge branch 'x86/unify-cpu-detect' into x86-v28-for-linus-phase4-D</title>
<updated>2008-10-11T18:23:20Z</updated>
<author>
<name>Ingo Molnar</name>
</author>
<published>2008-10-11T18:23:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0afe2db21394820d32646a695eccf3fbfe6ab5c7'/>
<id>urn:sha1:0afe2db21394820d32646a695eccf3fbfe6ab5c7</id>
<content type='text'>
Conflicts:
	arch/x86/kernel/cpu/common.c
	arch/x86/kernel/signal_64.c
	include/asm-x86/cpufeature.h
</content>
</entry>
<entry>
<title>x86: drop -funroll-loops for csum_partial_64.c</title>
<updated>2008-09-04T15:42:06Z</updated>
<author>
<name>Andi Kleen</name>
</author>
<published>2008-09-04T11:46:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fb481dd56adf3c5b0993b8f052cc9ba966e3959d'/>
<id>urn:sha1:fb481dd56adf3c5b0993b8f052cc9ba966e3959d</id>
<content type='text'>
Impact: performance optimization

I did some rebenchmarking with modern compilers and dropping
-funroll-loops makes the function consistently go faster by a few
percent.  So drop that flag.

Thanks to Richard Guenther for a hint.

Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;
Signed-off-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'x86/urgent' into x86/cpu</title>
<updated>2008-08-28T02:17:07Z</updated>
<author>
<name>H. Peter Anvin</name>
</author>
<published>2008-08-28T02:17:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b30a72a7edfc64c8929104d5c2178aca489aa559'/>
<id>urn:sha1:b30a72a7edfc64c8929104d5c2178aca489aa559</id>
<content type='text'>
Conflicts:

	arch/x86/kernel/cpu/cyrix.c
</content>
</entry>
<entry>
<title>x86: msr-on-cpu: remove unnecessary level of abstraction</title>
<updated>2008-08-26T05:45:50Z</updated>
<author>
<name>H. Peter Anvin</name>
</author>
<published>2008-08-26T00:44:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bdd314616f7218e325aa9637a46159ecba44cfeb'/>
<id>urn:sha1:bdd314616f7218e325aa9637a46159ecba44cfeb</id>
<content type='text'>
Remove an unnecessary level of abstraction in the msr-on-cpu library.
Although this duplicates some code, the duplicated code is less than
the additional code, and this way should be faster.

Additionally, change the order of the functions to make the regular
structure of this file more obvious.

Signed-off-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'x86/urgent' into x86/cleanups</title>
<updated>2008-08-26T05:45:37Z</updated>
<author>
<name>H. Peter Anvin</name>
</author>
<published>2008-08-26T05:45:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=94d4ac2f4a58c6e37876827c6688c61cef21290c'/>
<id>urn:sha1:94d4ac2f4a58c6e37876827c6688c61cef21290c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>x86: msr: propagate errors from smp_call_function_single()</title>
<updated>2008-08-26T00:45:48Z</updated>
<author>
<name>H. Peter Anvin</name>
</author>
<published>2008-08-26T00:27:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c6f31932d0a1d2b13952f506ebc92675e2d8df80'/>
<id>urn:sha1:c6f31932d0a1d2b13952f506ebc92675e2d8df80</id>
<content type='text'>
Propagate error (-ENXIO) from smp_call_function_single().  These
errors can happen when a CPU is unplugged while the MSR driver is
open.

Signed-off-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
</content>
</entry>
<entry>
<title>x86: make movsl_mask definition non-CPU specific</title>
<updated>2008-08-18T14:05:45Z</updated>
<author>
<name>Thomas Petazzoni</name>
</author>
<published>2008-08-18T10:33:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8bfcb3960fde049b863266dab8c3617bb5a541aa'/>
<id>urn:sha1:8bfcb3960fde049b863266dab8c3617bb5a541aa</id>
<content type='text'>
movsl_mask is currently defined in arch/x86/kernel/cpu/intel.c, which
contains code specific to Intel CPUs. However, movsl_mask is used in
the non-CPU specific code in arch/x86/lib/usercopy_32.c, which breaks
the compilation when support for Intel CPUs is compiled out.

This patch solves this problem by moving movsl_mask's definition close
to its users in arch/x86/lib/usercopy_32.c.

Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@free-electrons.com&gt;
Cc: michael@free-electrons.com
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>x86: coding style fixes to arch/x86/lib/string_32.c</title>
<updated>2008-08-15T14:53:25Z</updated>
<author>
<name>Paolo Ciarrocchi</name>
</author>
<published>2008-08-02T19:25:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3492cdf0176bde5e35223a1388d59676bc67c145'/>
<id>urn:sha1:3492cdf0176bde5e35223a1388d59676bc67c145</id>
<content type='text'>
Before:
total: 21 errors, 0 warnings, 237 lines checked

After:
total: 0 errors, 0 warnings, 237 lines checked

paolo@paolo-desktop:~/linux.trees.git$ md5sum /tmp/string_32.o.*
c55d059ef1612b32a8bb2771a72ae0d5  /tmp/string_32.o.after
c55d059ef1612b32a8bb2771a72ae0d5  /tmp/string_32.o.before

Signed-off-by: Paolo Ciarrocchi &lt;paolo.ciarrocchi@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>x86: coding style fixes to arch/x86/lib/strstr_32.c</title>
<updated>2008-08-15T14:53:24Z</updated>
<author>
<name>Paolo Ciarrocchi</name>
</author>
<published>2008-08-02T19:24:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=209b580fd8c3a42b69550c98de434671d41a4ebb'/>
<id>urn:sha1:209b580fd8c3a42b69550c98de434671d41a4ebb</id>
<content type='text'>
Before:
total: 3 errors, 0 warnings, 31 lines checked

After:
total: 0 errors, 0 warnings, 31 lines checked

paolo@paolo-desktop:~/linux.trees.git$ md5sum /tmp/strstr_32.o.*
c96006ec3387862e5bacb139207a3098  /tmp/strstr_32.o.after
c96006ec3387862e5bacb139207a3098  /tmp/strstr_32.o.before

Signed-off-by: Paolo Ciarrocchi &lt;paolo.ciarrocchi@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
</feed>
