<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/x86/kernel/process_32.c, branch linux-2.6.30.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.30.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.30.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2009-04-03T02:04:51Z</updated>
<entry>
<title>Simplify copy_thread()</title>
<updated>2009-04-03T02:04:51Z</updated>
<author>
<name>Alexey Dobriyan</name>
</author>
<published>2009-04-02T23:56:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6f2c55b843836d26528c56a0968689accaedbc67'/>
<id>urn:sha1:6f2c55b843836d26528c56a0968689accaedbc67</id>
<content type='text'>
First argument unused since 2.3.11.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Cc: &lt;linux-arch@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>x86: unify chunks of kernel/process*.c</title>
<updated>2009-03-02T11:07:48Z</updated>
<author>
<name>Jeremy Fitzhardinge</name>
</author>
<published>2009-02-27T21:25:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=389d1fb11e5f2a16b5e34c547756f0c4dec641f7'/>
<id>urn:sha1:389d1fb11e5f2a16b5e34c547756f0c4dec641f7</id>
<content type='text'>
With x86-32 and -64 using the same mechanism for managing the
tss io permissions bitmap, large chunks of process*.c are
trivially unifyable, including:

 - exit_thread
 - flush_thread
 - __switch_to_xtra (along with tsc enable/disable)

and as bonus pickups:

 - sys_fork
 - sys_vfork

(Note: asmlinkage expands to empty on x86-64)

Signed-off-by: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>x86-32: use non-lazy io bitmap context switching</title>
<updated>2009-03-02T11:07:48Z</updated>
<author>
<name>Jeremy Fitzhardinge</name>
</author>
<published>2009-02-27T21:25:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=db949bba3c7cf2e664ac12e237c6d4c914f0c69d'/>
<id>urn:sha1:db949bba3c7cf2e664ac12e237c6d4c914f0c69d</id>
<content type='text'>
Impact: remove 32-bit optimization to prepare unification

x86-32 and -64 differ in the way they context-switch tasks
with io permission bitmaps.  x86-64 simply copies the next
tasks io bitmap into place (if any) on context switch.  x86-32
invalidates the bitmap on context switch, so that the next
IO instruction will fault; at that point it installs the
appropriate IO bitmap.

This makes context switching IO-bitmap-using tasks a bit more
less expensive, at the cost of making the next IO instruction
slower due to the extra fault.  This tradeoff only makes sense
if IO-bitmap-using processes are relatively common, but they
don't actually use IO instructions very often.

However, in a typical desktop system, the only process likely
to be using IO bitmaps is the X server, and nothing at all on
a server.  Therefore the lazy context switch doesn't really win
all that much, and its just a gratuitious difference from
64-bit code.

This patch removes the lazy context switch, with a view to
unifying this code in a later change.

Signed-off-by: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>Merge branch 'linus' into x86/apic</title>
<updated>2009-02-22T19:05:19Z</updated>
<author>
<name>Ingo Molnar</name>
</author>
<published>2009-02-22T19:05:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fc6fc7f1b1095b92d4834e69b385b91e412a7ce5'/>
<id>urn:sha1:fc6fc7f1b1095b92d4834e69b385b91e412a7ce5</id>
<content type='text'>
Conflicts:
	arch/x86/mach-default/setup.c

Semantic conflict resolution:
	arch/x86/kernel/setup.c

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>x86, rcu: fix strange load average and ksoftirqd behavior</title>
<updated>2009-02-17T21:47:45Z</updated>
<author>
<name>Paul E. McKenney</name>
</author>
<published>2009-02-17T14:01:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bf51935f3e988e0ed6f34b55593e5912f990750a'/>
<id>urn:sha1:bf51935f3e988e0ed6f34b55593e5912f990750a</id>
<content type='text'>
Damien Wyart reported high ksoftirqd CPU usage (20%) on an
otherwise idle system.

The function-graph trace Damien provided:

&gt;   799.521187 |   1)    &lt;idle&gt;-0    |               |  rcu_check_callbacks() {
&gt;   799.521371 |   1)    &lt;idle&gt;-0    |               |  rcu_check_callbacks() {
&gt;   799.521555 |   1)    &lt;idle&gt;-0    |               |  rcu_check_callbacks() {
&gt;   799.521738 |   1)    &lt;idle&gt;-0    |               |  rcu_check_callbacks() {
&gt;   799.521934 |   1)    &lt;idle&gt;-0    |               |  rcu_check_callbacks() {
&gt;   799.522068 |   1)  ksoftir-2324  |               |                rcu_check_callbacks() {
&gt;   799.522208 |   1)    &lt;idle&gt;-0    |               |  rcu_check_callbacks() {
&gt;   799.522392 |   1)    &lt;idle&gt;-0    |               |  rcu_check_callbacks() {
&gt;   799.522575 |   1)    &lt;idle&gt;-0    |               |  rcu_check_callbacks() {
&gt;   799.522759 |   1)    &lt;idle&gt;-0    |               |  rcu_check_callbacks() {
&gt;   799.522956 |   1)    &lt;idle&gt;-0    |               |  rcu_check_callbacks() {
&gt;   799.523074 |   1)  ksoftir-2324  |               |                  rcu_check_callbacks() {
&gt;   799.523214 |   1)    &lt;idle&gt;-0    |               |  rcu_check_callbacks() {
&gt;   799.523397 |   1)    &lt;idle&gt;-0    |               |  rcu_check_callbacks() {
&gt;   799.523579 |   1)    &lt;idle&gt;-0    |               |  rcu_check_callbacks() {
&gt;   799.523762 |   1)    &lt;idle&gt;-0    |               |  rcu_check_callbacks() {
&gt;   799.523960 |   1)    &lt;idle&gt;-0    |               |  rcu_check_callbacks() {
&gt;   799.524079 |   1)  ksoftir-2324  |               |                  rcu_check_callbacks() {
&gt;   799.524220 |   1)    &lt;idle&gt;-0    |               |  rcu_check_callbacks() {
&gt;   799.524403 |   1)    &lt;idle&gt;-0    |               |  rcu_check_callbacks() {
&gt;   799.524587 |   1)    &lt;idle&gt;-0    |               |  rcu_check_callbacks() {
&gt;   799.524770 |   1)    &lt;idle&gt;-0    |               |  rcu_check_callbacks() {
&gt; [ . . . ]

Shows rcu_check_callbacks() being invoked way too often. It should be called
once per jiffy, and here it is called no less than 22 times in about
3.5 milliseconds, meaning one call every 160 microseconds or so.

Why do we need to call rcu_pending() and rcu_check_callbacks() from the
idle loop of 32-bit x86, especially given that no other architecture does
this?

The following patch removes the call to rcu_pending() and
rcu_check_callbacks() from the x86 32-bit idle loop in order to
reduce the softirq load on idle systems.

Reported-by: Damien Wyart &lt;damien.wyart@free.fr&gt;
Signed-off-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>x86: use regparm(3) for passed-in pt_regs pointer</title>
<updated>2009-02-11T22:00:56Z</updated>
<author>
<name>Brian Gerst</name>
</author>
<published>2009-02-11T21:43:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b12bdaf11f935d7be030207e3c77faeaeab8ded3'/>
<id>urn:sha1:b12bdaf11f935d7be030207e3c77faeaeab8ded3</id>
<content type='text'>
Some syscalls need to access the pt_regs structure, either to copy
user register state or to modifiy it.  This patch adds stubs to load
the address of the pt_regs struct into the %eax register, and changes
the syscalls to take the pointer as an argument instead of relying on
the assumption that the pt_regs structure overlaps the function
arguments.

Drop the use of regparm(1) due to concern about gcc bugs, and to move
in the direction of the eventual removal of regparm(0) for asmlinkage.

Signed-off-by: Brian Gerst &lt;brgerst@gmail.com&gt;
Signed-off-by: H. Peter Anvin &lt;hpa@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>x86: pass in pt_regs pointer for syscalls that need it</title>
<updated>2009-02-11T11:40:45Z</updated>
<author>
<name>Brian Gerst</name>
</author>
<published>2009-02-10T14:51:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=253f29a4ae9cc6cdc7b94f96517f27a93885a6ce'/>
<id>urn:sha1:253f29a4ae9cc6cdc7b94f96517f27a93885a6ce</id>
<content type='text'>
Some syscalls need to access the pt_regs structure, either to copy
user register state or to modifiy it.  This patch adds stubs to load
the address of the pt_regs struct into the %eax register, and changes
the syscalls to regparm(1) to receive the pt_regs pointer as the
first argument.

Signed-off-by: Brian Gerst &lt;brgerst@gmail.com&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>x86: fix x86_32 stack protector bugs</title>
<updated>2009-02-11T10:33:49Z</updated>
<author>
<name>Tejun Heo</name>
</author>
<published>2009-02-11T07:31:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5c79d2a517a9905599d192db8ce77ab5f1a2faca'/>
<id>urn:sha1:5c79d2a517a9905599d192db8ce77ab5f1a2faca</id>
<content type='text'>
Impact: fix x86_32 stack protector

Brian Gerst found out that %gs was being initialized to stack_canary
instead of stack_canary - 20, which basically gave the same canary
value for all threads.  Fixing this also exposed the following bugs.

* cpu_idle() didn't call boot_init_stack_canary()

* stack canary switching in switch_to() was being done too late making
  the initial run of a new thread use the old stack canary value.

Fix all of them and while at it update comment in cpu_idle() about
calling boot_init_stack_canary().

Reported-by: Brian Gerst &lt;brgerst@gmail.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>x86: implement x86_32 stack protector</title>
<updated>2009-02-09T23:42:01Z</updated>
<author>
<name>Tejun Heo</name>
</author>
<published>2009-02-09T13:17:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=60a5317ff0f42dd313094b88f809f63041568b08'/>
<id>urn:sha1:60a5317ff0f42dd313094b88f809f63041568b08</id>
<content type='text'>
Impact: stack protector for x86_32

Implement stack protector for x86_32.  GDT entry 28 is used for it.
It's set to point to stack_canary-20 and have the length of 24 bytes.
CONFIG_CC_STACKPROTECTOR turns off CONFIG_X86_32_LAZY_GS and sets %gs
to the stack canary segment on entry.  As %gs is otherwise unused by
the kernel, the canary can be anywhere.  It's defined as a percpu
variable.

x86_32 exception handlers take register frame on stack directly as
struct pt_regs.  With -fstack-protector turned on, gcc copies the
whole structure after the stack canary and (of course) doesn't copy
back on return thus losing all changed.  For now, -fno-stack-protector
is added to all files which contain those functions.  We definitely
need something better.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>x86: make lazy %gs optional on x86_32</title>
<updated>2009-02-09T23:42:00Z</updated>
<author>
<name>Tejun Heo</name>
</author>
<published>2009-02-09T13:17:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ccbeed3a05908d201b47b6c3dd1a373138bba566'/>
<id>urn:sha1:ccbeed3a05908d201b47b6c3dd1a373138bba566</id>
<content type='text'>
Impact: pt_regs changed, lazy gs handling made optional, add slight
        overhead to SAVE_ALL, simplifies error_code path a bit

On x86_32, %gs hasn't been used by kernel and handled lazily.  pt_regs
doesn't have place for it and gs is saved/loaded only when necessary.
In preparation for stack protector support, this patch makes lazy %gs
handling optional by doing the followings.

* Add CONFIG_X86_32_LAZY_GS and place for gs in pt_regs.

* Save and restore %gs along with other registers in entry_32.S unless
  LAZY_GS.  Note that this unfortunately adds "pushl $0" on SAVE_ALL
  even when LAZY_GS.  However, it adds no overhead to common exit path
  and simplifies entry path with error code.

* Define different user_gs accessors depending on LAZY_GS and add
  lazy_save_gs() and lazy_load_gs() which are noop if !LAZY_GS.  The
  lazy_*_gs() ops are used to save, load and clear %gs lazily.

* Define ELF_CORE_COPY_KERNEL_REGS() which always read %gs directly.

xen and lguest changes need to be verified.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Jeremy Fitzhardinge &lt;jeremy@xensource.com&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
</feed>
