android_kernel_xiaomi_sm7250/arch/i386
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
..
boot [PATCH] x86: gitignore some autogenerated files for i386 2006-02-14 16:09:35 -08:00
crypto [CRYPTO] aes-i586: Remove unused variable ls_tab 2006-01-09 14:15:53 -08:00
kernel [PATCH] x86: SMP alternatives 2006-03-23 07:38:04 -08:00
lib [LIB]: Consolidate _atomic_dec_and_lock() 2005-09-14 21:47:01 -07:00
mach-default [PATCH] Fix topology.c location 2006-02-24 14:31:39 -08:00
mach-es7000 [PATCH] ES7000 platform update 2005-10-30 17:37:12 -08:00
mach-generic [PATCH] x86: sutomatically enable bigsmp when we have more than 8 CPUs 2005-09-05 00:06:10 -07:00
mach-visws [PATCH] useless includes of linux/irq.h in arch/i386 2005-09-26 18:29:50 -07:00
mach-voyager [PATCH] fix voyager after topology.c move 2006-02-26 19:10:30 -08:00
math-emu [PATCH] i386: inline assembler: cleanup and encapsulate descriptor and task register management 2005-09-05 00:06:11 -07:00
mm [PATCH] x86: SMP alternatives 2006-03-23 07:38:04 -08:00
oprofile [PATCH] x86: fix oprofile kernel callgraph regression 2006-02-14 08:25:29 -08:00
pci [PATCH] PCI: handle bogus MCFG entries 2006-01-31 18:00:13 -08:00
power [PATCH] x86: add MCE resume 2005-11-07 07:53:30 -08:00
defconfig update the i386 defconfig 2006-03-20 20:14:06 +01:00
Kconfig [PATCH] Make CONFIG_REGPARM enabled by default 2006-03-23 07:38:03 -08:00
Kconfig.cpu [PATCH] Base support for AMD Geode GX/LX processors 2006-01-06 08:33:38 -08:00
Kconfig.debug [PATCH] i386: multi-column stack backtraces 2006-03-23 07:38:03 -08:00
Makefile [PATCH] i386: remove gcc version check for CONFIG_REGPARM 2006-01-16 23:15:25 -08:00
Makefile.cpu [PATCH] remove gcc-2 checks 2006-01-08 20:14:02 -08:00