linux/arch
Gerd Hoffmann 9a0b5817ad [PATCH] x86: SMP alternatives
Implement SMP alternatives, i.e.  switching at runtime between different
code versions for UP and SMP.  The code can patch both SMP->UP and UP->SMP.
The UP->SMP case is useful for CPU hotplug.

With CONFIG_CPU_HOTPLUG enabled the code switches to UP at boot time and
when the number of CPUs goes down to 1, and switches to SMP when the number
of CPUs goes up to 2.

Without CONFIG_CPU_HOTPLUG or on non-SMP-capable systems the code is
patched once at boot time (if needed) and the tables are released
afterwards.

The changes in detail:

  * The current alternatives bits are moved to a separate file,
    the SMP alternatives code is added there.

  * The patch adds some new elf sections to the kernel:
    .smp_altinstructions
	like .altinstructions, also contains a list
	of alt_instr structs.
    .smp_altinstr_replacement
	like .altinstr_replacement, but also has some space to
	save original instruction before replaving it.
    .smp_locks
	list of pointers to lock prefixes which can be nop'ed
	out on UP.
    The first two are used to replace more complex instruction
    sequences such as spinlocks and semaphores.  It would be possible
    to deal with the lock prefixes with that as well, but by handling
    them as special case the table sizes become much smaller.

 * The sections are page-aligned and padded up to page size, so they
   can be free if they are not needed.

 * Splitted the code to release init pages to a separate function and
   use it to release the elf sections if they are unused.

Signed-off-by: Gerd Hoffmann <kraxel@suse.de>
Signed-off-by: Chuck Ebbert <76306.1226@compuserve.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-23 07:38:04 -08:00
..
alpha [PATCH] remove set_page_count() outside mm/ 2006-03-22 07:54:02 -08:00
arm Merge master.kernel.org:/home/rmk/linux-2.6-arm 2006-03-22 17:32:09 -08:00
arm26 [PATCH] remove set_page_count() outside mm/ 2006-03-22 07:54:02 -08:00
cris [PATCH] remove set_page_count() outside mm/ 2006-03-22 07:54:02 -08:00
frv [PATCH] remove set_page_count() outside mm/ 2006-03-22 07:54:02 -08:00
h8300 [PATCH] remove set_page_count() outside mm/ 2006-03-22 07:54:02 -08:00
i386 [PATCH] x86: SMP alternatives 2006-03-23 07:38:04 -08:00
ia64 [PATCH] hugepage: is_aligned_hugepage_range() cleanup 2006-03-22 07:54:04 -08:00
m32r [PATCH] remove set_page_count() outside mm/ 2006-03-22 07:54:02 -08:00
m68k [PATCH] remove set_page_count() outside mm/ 2006-03-22 07:54:02 -08:00
m68knommu [PATCH] remove set_page_count() outside mm/ 2006-03-22 07:54:02 -08:00
mips [PATCH] remove set_page_count() outside mm/ 2006-03-22 07:54:02 -08:00
parisc [PATCH] remove set_page_count() outside mm/ 2006-03-22 07:54:02 -08:00
powerpc Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2006-03-22 22:20:46 -08:00
ppc Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2006-03-22 22:20:46 -08:00
s390 [PATCH] remove set_page_count() outside mm/ 2006-03-22 07:54:02 -08:00
sh [PATCH] hugepage: is_aligned_hugepage_range() cleanup 2006-03-22 07:54:04 -08:00
sh64 [PATCH] hugepage: is_aligned_hugepage_range() cleanup 2006-03-22 07:54:04 -08:00
sparc Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6 2006-03-22 10:56:57 -08:00
sparc64 [PATCH] sparc64: fix set_page_count merge clash 2006-03-23 07:15:21 -08:00
um [PATCH] x86: SMP alternatives 2006-03-23 07:38:04 -08:00
v850 [PATCH] add EXPORT_SYMBOL_GPL_FUTURE() 2006-03-20 13:42:58 -08:00
x86_64 [PATCH] remove set_page_count() outside mm/ 2006-03-22 07:54:02 -08:00
xtensa [PATCH] remove set_page_count() outside mm/ 2006-03-22 07:54:02 -08:00