Commit Graph

1883 Commits (2fe60147570231cde0d1f14711d2e34ccdf54b65)

Author SHA1 Message Date
venkatesh.pallipadi@intel.com 3a96ce8cac x86: PAT make ioremap_change_attr non-static
Make ioremap_change_attr() non-static and use prot_val in place of ioremap_mode.
This interface is used in subsequent PAT patches.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:19 +02:00
Ingo Molnar 55c626820a x86: revert ucminus change
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:19 +02:00
venkatesh.pallipadi@intel.com 2e5d9c857d x86: PAT infrastructure patch
Sets up pat_init() infrastructure.

PAT MSR has following setting.
	PAT
	|PCD
	||PWT
	|||
	000 WB		_PAGE_CACHE_WB
	001 WC		_PAGE_CACHE_WC
	010 UC-		_PAGE_CACHE_UC_MINUS
	011 UC		_PAGE_CACHE_UC

We are effectively changing WT from boot time setting to WC.
UC_MINUS is used to provide backward compatibility to existing /dev/mem
users(X).

reserve_memtype and free_memtype are new interfaces for maintaining alias-free
mapping. It is currently implemented in a simple way with a linked list and
not optimized. reserve and free tracks the effective memory type, as a result
of PAT and MTRR setting rather than what is actually requested in PAT.

pat_init piggy backs on mtrr_init as the rules for setting both pat and mtrr
are same.

Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:19 +02:00
Pavel Machek 7de6a4cdac x86: clean up aperture_64.c
Initializing to zero is generally bad idea, I hope it is right for
__init data, too.

Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:19 +02:00
Yinghai Lu 01561264bd x86: allocate e820 resource struct all together
don't need to allocate that one by one

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:19 +02:00
Yinghai Lu 272b9cad6e x86: early memtest to find bad ram
do simple memtest after init_memory_mapping

use find_e820_area_size to find all ram range that is not reserved.

and do some simple bits test to find some bad ram.

if find some bad ram, use reserve_early to exclude that range.

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:19 +02:00
Robert P. J. Day 0054f4b708 x86: Explicitly include required header files.
After an experimental cleanup of <linux/percpu.h>, these files were
exposed as invoking kmalloc() without including <linux/slab.h>.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:15 +02:00
Yakov Lerner acb5b8a2dd x86, kprobes: correct post-eip value in post_hander()
I was trying to get the address of instruction to be executed
next after the kprobed instruction.  But regs->eip in post_handler()
contains value which is useless to the user. It's pre-corrected value.
This value is difficult to use without access to resume_execution(), which
is not exported anyway.
I moved the invocation of post_handler() to *after* resume_execution().
Now regs->eip contains meaningful value in post_handler().

I do not think this change breaks any backward-compatibility.
To make meaning of the old value, post_handler() would need access to
resume_execution() which is not exported.  I have difficulty to believe
that previous, uncorrected, regs->eip can be meaningfully used in
post_handler().

Signed-off-by: Yakov Lerner <iler.ml@gmail.com>
Acked-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Acked-by: Masami Hiramatsu <mhiramat@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:13 +02:00
Roland McGrath 0f54091051 x86: handle_vm86_trap cleanup
Use force_sig in handle_vm86_trap like other machine traps do.

Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:13 +02:00
Roland McGrath b00de174e3 x86: sys32_execve PT_DTRACE
The PT_DTRACE flag is meaningless and obsolete.
Don't touch it.

Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:13 +02:00
Roland McGrath 48ee679a02 x86: ia32 ptrace vs -ENOSYS sysenter/syscall
The previous "x86_64 ia32 ptrace vs -ENOSYS" fix only covered
the int $0x80 system call entries.  This does the same fix
for the sysenter and syscall instruction paths.

Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:13 +02:00
Roland McGrath a31f8dd7ee x86: ptrace vs -ENOSYS
When we're stopped at syscall entry tracing, ptrace can change the %rax
value from -ENOSYS to something else.  If no system call is actually made
because the syscall number (now in orig_rax) is bad, then we now always
reset %rax to -ENOSYS again.

This changes it to leave the return value alone after entry tracing.
That way, the %rax value set by ptrace is there to be seen in user mode
(or in syscall exit tracing).  This is consistent with what the 32-bit
kernel does.

Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:13 +02:00
Roland McGrath 8ab32bb89b x86: ia32 ptrace vs -ENOSYS
When we're stopped at syscall entry tracing, ptrace can change the %eax
value from -ENOSYS to something else.  If no system call is actually made
because the syscall number (now in orig_eax) is bad, then the %eax value
set by ptrace should be returned to the user.  But, instead it gets reset
to -ENOSYS again.  This is a regression from the native 32-bit kernel.

This change fixes it by leaving the return value alone after entry tracing.

Signed-off-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:13 +02:00
Adrian Bunk ede1389f8a x86: remove the write-only timer_uses_ioapic_pin_0
This patch removes the write-only timer_uses_ioapic_pin_0
(gsi can't be <= 15 in the line of it's fake usage in mpparse_32.c).

Spotted by the GNU C compiler.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:13 +02:00
Ingo Molnar 6542fe80e6 x86: vsmp fix x86 vsmp fix is vsmp box cleanup
code got a bit smaller:

arch/x86/kernel/vsmp_64.o:

   text	   data	    bss	    dec	    hex	filename
    205	      4	      0	    209	     d1	vsmp_64.o.before
    181	      4	      0	    185	     b9	vsmp_64.o.after

Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:08 +02:00
Ravikiran G Thirumalai 1cb68487f5 x86: apic_is_clustered_box to indicate unsynched TSC's on multiboard vSMP systems
Indicate TSCs are unreliable as time sources if the platform is
a multi chassi ScaleMP vSMPowered machine.

Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:08 +02:00
Ravikiran G Thirumalai 9f6d8552a9 x86: vSMP: use pvops only if platform has the capability to support it
Re-arrange set_vsmp_pv_ops so that pv_ops are set only if
the platform has capability to support paravirtualized irq ops

Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:08 +02:00
Ravikiran G Thirumalai aa7d8e25ec x86: fix build breakage when PCI is define and PARAVIRT is not
- Fix the the build breakage when PARAVIRT is defined
  but PCI is not
  This fixes problem reported at:
	http://marc.info/?l=linux-kernel&m=120525966600698&w=2
- Make is_vsmp_box() available even when PARAVIRT is not defined.
  This is needed to determine if tsc's are reliable as a time source
  even when PARAVIRT is not defined.
- split vsmp_init to use is_vsmp_box() and set_vsmp_pv_ops()
  set_vsmp_pv_ops will do nothing if PCI is not enabled in the config.

Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:08 +02:00
Ravikiran G Thirumalai 3250c91ada x86: vSMP: Fix is_vsmp_box()
is_vsmp_box() currently does not work on vSMPowered systems,  as pci cfg
space is not read correctly -- This patch fixes it.

Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:08 +02:00
Alexey Starikovskiy 864205062f x86: make struct mpc_config_translation NUMAQ-only
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:08 +02:00
Alexey Starikovskiy 0ec153af4d x86: remove mpc_oem_bus_info()
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:08 +02:00
Alexey Starikovskiy d285e33889 x86: remove mpc_oem_pci_bus()
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:08 +02:00
Alexey Starikovskiy 4655c7deca x86: remove mpc_apic_id()
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:07 +02:00
Alexey Starikovskiy 555b07646d x86: rename gsi_start to gsi_base to match mpparse_32.c
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:05 +02:00
Alexey Starikovskiy 85e46035be x86: limit scan to 1k of EBDA.
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:05 +02:00
Alexey Starikovskiy ce3fe6b2bf x86: use get_bios_ebda in mpparse_64.c
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:05 +02:00
Alexey Starikovskiy e3e3ffa203 x86: add uniq_ioapic_id to mpparse_32.c
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:04 +02:00
Alexey Starikovskiy 857033a696 x86: add bad_ioapic to mpparse_32.c
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:04 +02:00
Alexey Starikovskiy d2953315c7 x86: lindent mpparse_64.c
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:04 +02:00
Glauber de Oliveira Costa 4cedb3343f x86: remove smpboot_32.c and smpboot_64.c
Remove the last leftovers from the files. Move the ones
that are still used to the files they belong, the others
that grep can't reach, simply throw away.

Merge comments ontop of file and that's it: smpboot integrated

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:04 +02:00
Glauber de Oliveira Costa acbb673418 x86: move apicid mappings to smpboot.c
They are i386 specific (the x86_64 definitions live
elsewhere, and should remain there), so are enclosed around
an ifdef

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:04 +02:00
Glauber de Oliveira Costa 2cd9fb71ee x86: merge cpu_exit_clear
this is the last remaining function in smpboot_32.c
Since it is i386 specific, move it around an ifdef to
smpboot.c

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:04 +02:00
Glauber de Oliveira Costa 8aef135c73 x86: merge native_smp_prepare_cpus
With the previous changes, code for native_smp_prepare_cpus()
in i386 and x86_64 now look very similar. merge them into
smpboot.c. Minor differences are inside ifdef

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:04 +02:00
Glauber de Oliveira Costa 9f3734f631 x86: introduce smpboot_clear_io_apic
x86_64 has two nr_ioapics = 0 statements. In 32-bit, it can be done
too. We do it through the smpboot_clear_io_apic() inline function,
to cope with subarchitectures (visws) that does not compile mpparse in

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:04 +02:00
Glauber de Oliveira Costa 771263d311 x86: change x86_64 sanity checks to match i386.
They are mostly inocuous. APIC_INTEGRATED will expand to 1,
check_phys_apicid_present is checking for the same thing it was before,
etc. But the code is identical to i386 now, and will allow us to
integrate it.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:04 +02:00
Glauber de Oliveira Costa 0df1ba8cab x86: add extra sanity check
This test exists in x86_64 and also applies to i386. So we add it

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:04 +02:00
Glauber de Oliveira Costa 1db17f5534 x86: change x86_64 native_smp_prepare_cpus to match i386
An APIC test is moved, and code is replaced by the mach-default
already defined function (smpboot_setup_io_apic).
setup_portio_remap() is added, but it is a nop in mach-default.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:04 +02:00
Glauber de Oliveira Costa 7cefaa20e7 x86: additions to i386 native_smp_prepare_cpus.
Add function calls to native_smp_prepare_cpus in i386
to match x86_64

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:04 +02:00
Glauber de Oliveira Costa e7bc8fbad4 x86: get rid of smp_boot_cpus
This patch get rid of smp_boot_cpus(), since it does not
boot any cpu anymore. Its code is split in a way to make
it closer to x86_64

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:04 +02:00
Glauber de Oliveira Costa bd7b47ba5e x86: use physical id when disabling smp
if smp configuration is not found at all, hook into 0.
This is done to match x86_64

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:04 +02:00
Glauber de Oliveira Costa 83f7eb9c67 x86: merge native_smp_cpus_done
They look similar enough, and are merged. Only difference
(zap_low_mapping for i386) is inside ifdef

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:04 +02:00
Glauber de Oliveira Costa a8db8453ff x86: merge smp_prepare_boot_cpu
it is practically the same between arches now, so it is
moved to smpboot.c. Minor differences (gdt initialization)
live inside an ifdef

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:03 +02:00
Glauber de Oliveira Costa bbc2ff6a91 x86: integrate start_secondary
It now looks the same between architectures, so we
merge it in smpboot.c. Minor differences goes inside
an ifdef

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:03 +02:00
Glauber de Oliveira Costa cb3c8b9003 x86: integrate do_boot_cpu
This is a very large patch, because it depends on a lot
of auxiliary static functions. But they all have been modified
to the point that they're sufficiently close now. So they're just
merged in smpboot.c

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:03 +02:00
Glauber de Oliveira Costa c70dcb7430 x86: change boot_cpu_id to boot_cpu_physical_apicid
This is to match i386. The former name was cuter,
but the current is more meaningful and more general,
since cpu_id can be a logical id.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:02 +02:00
Glauber de Oliveira Costa 9d97d0da71 x86: move stack_start to smp.h
voyager would conflict with it, but the types are ultimately
compatible. So remove the extern definition from voyager_smp.c
in favour of the common one

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:02 +02:00
Glauber de Oliveira Costa 7cc3959ecd x86: move {un}map_cpu_to_logical_apicid to smpboot.c
Move map_cpu_to_logical_apicid() and unmap_cpu_to_logical_apicid()
to smpboot.c. They take together all the bunch of static functions
they rely upon

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:02 +02:00
Glauber de Oliveira Costa b9f9294a86 x86: add callin tests to cpu_up
Now that we boot cpus here, callin_map has this meaning (same
as x86_64)

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:02 +02:00
Glauber de Oliveira Costa 0717826927 x86: change wakeup_secondary name
wakeup_secondary_via_INIT => wakeup_secondary_cpu.

This is to match i386, where init is not always used.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:02 +02:00
Glauber de Oliveira Costa f6bc402909 x86: include mach_apic.h in smpboot_64.c and smpboot.c
After the inclusion, a lot of files needs fixing for conflicts,
some of them in the headers themselves, to accomodate for both
i386 and x86_64 versions.

[ mingo@elte.hu: build fix ]

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:02 +02:00
Glauber de Oliveira Costa 4370ee4d3b x86: call do_boot_cpu directly from native_cpu_up
We don't need __smp_prepare_cpu anymore.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:02 +02:00
Glauber de Oliveira Costa 6becedbb06 x86: minor adjustments for do_boot_cpu
This patch provides minor adjustments for do_boot_cpus
in both architectures to allow for integration

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:02 +02:00
Glauber de Oliveira Costa e481fcf856 x86: calibrate delay with irqs enabled
We do it to make it close to x86_64. The later needs it,
otherwise the nmi watchdog can get into the scene and kill us
with a hammer.

Enabling irqs here used to trigger a bug in i386. This is because
time irq handling relies upon structures that are only initialized
after smp initcalls (More precisely, it will find
per_cpu(hrtimer_bases, cpu)->cb_pending list not initialized and crash)

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:02 +02:00
Glauber de Oliveira Costa ac60aae561 x86: provide an end_local_APIC_setup function
It splits setup_local_APIC in two, providing a function corresponding
to the ending part of it. As a side effect, smp_callin looks the same
between i386 and x86_64.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:02 +02:00
Glauber de Oliveira Costa df7939ae8b x86: wrap esr setting up in i386 in lapic_setup_esr
it is a little bit more complicated than x86_64 due to erratas and
other stuff, but its existance will ease integration

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:02 +02:00
Glauber de Oliveira Costa ea0cadbfed x86: modify smp_callin in x86_64 to look like i386
We introduce empty macros just to make them look like the same

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:02 +02:00
Glauber de Oliveira Costa 4c07ad6950 x86: don't span a new worker in __smp_prepare_cpu
We can do it now that do_boot_cpu has its own worker.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:02 +02:00
Glauber de Oliveira Costa 365c894c65 x86: use create_idle struct in do_boot_cpu
Use a new worker, with help of the create_idle struct
to fork the idle thread. We now have two workers, the first
of them triggered by __smp_prepare_cpu. But the later is
going away soon.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:02 +02:00
Glauber de Oliveira Costa ddd10ecfa2 x86: get rid of commenced mask.
As we now boot cpus from cpu_up, we don't need it.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:02 +02:00
Glauber de Oliveira Costa 9713277607 x86: boot cpus from cpu_up, instead of prepare_cpus
After all the infrastructure work, we're now prepared
to boot the cpus from cpu_up, and not from prepare_cpus.
So the difference between cold boot and hotplug is effectively
over, and the functions are used to the purposes they're meant to.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:02 +02:00
Glauber de Oliveira Costa d2bcbad5f3 x86: do not zap_low_mappings in __smp_prepare_cpus
It was okay when cpus were cold booted before this point.
But with the new state machine, they will not have arrived to
the trampoline yet. zapping low mappings will have the bad effect
of breaking it completely after paging enablement

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:02 +02:00
Glauber de Oliveira Costa 802b8133b4 x86: schedule work only if keventd is already running
Only call schedule_work if keventd is already running.
This is already the way x86_64 does

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:02 +02:00
Glauber de Oliveira Costa e7f8b14e02 x86: don't initialize sibling and core maps during preparation
it is redundant, since it is already done by set_cpu_sibling_map()

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:01 +02:00
Glauber de Oliveira Costa 50e440aa53 x86: call nmi_watchdog_default in i386
this does not exist, so it will be an empty macro

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:01 +02:00
Glauber de Oliveira Costa 4626df1801 x86: call check_nmi_watchdog explicitly in native_smp_cpus_done
With this, remove its late_initcall marker from nmi_32.c

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:01 +02:00
Glauber de Oliveira Costa 6d60cd5359 x86: unify nmi_32.h and nmi_64.h
Two more files goes away. nmi_64.h and nmi_32.h gives birth
to nmi.h

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:01 +02:00
Glauber de Oliveira Costa e32ede19ac x86: wipe get_nmi_reason out of nmi_64.h
use mach_traps when it is supposed to be used.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:01 +02:00
Glauber de Oliveira Costa 3cf19f31d9 x86: don't set maps in native_smp_prepare_boot_cpu()
By this time, they are already set in init routines

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:01 +02:00
Glauber de Oliveira Costa 17c9ab1eab x86: move smp_intr_init away from smpboot_32.c
We move it to apic_32.c, since it's irq related anyway,
and only called from that file.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:01 +02:00
Glauber de Oliveira Costa eb44d0a2a9 x86: include smpboot_hooks.h in smpboot_64.c
We do it and also fix conflicts, which makes x86_64 automatically
closer to i386

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:01 +02:00
Glauber de Oliveira Costa 8d77010f8c x86: include mach_wakecpu.h in smpboot_64
Do it and also fix conflicts, which automatically makes
x86_64 look closer to i386

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:01 +02:00
Glauber de Oliveira Costa ee09efc3e4 x86: add subarch support (for headers) to x86_64
this patch allows x86_64 to use subarch mach_ headers
in practice, since x86_64 does not have any subarch, it
will use mach_default. But it will allow for substantially
less code duplication

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:01 +02:00
Glauber de Oliveira Costa f68e00a32b x86: move impress_friends and smp_check to cpus_done
the cpu count is changed accordingly: now, what matters is
online cpus.
Also, we add those functions for x86_64

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:01 +02:00
Glauber de Oliveira Costa 693d4b8a64 x86: do smp tainting checks in a separate function
It will ease integration for x86_64

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:01 +02:00
Glauber de Oliveira Costa 904541e2f7 x86: allow user to impress friends.
Impressing friends is a very important thing.
Do it in a separate function to make it even more
explicit, and ease integration.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:01 +02:00
Glauber de Oliveira Costa e1a14d0c13 x86: get rid of cpucount
weighting a map will do.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:01 +02:00
Ingo Molnar 1161705bd6 x86: fill cpu to apicid and present map in mpparse, fix
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:01 +02:00
Glauber de Oliveira Costa a6c422ccdb x86: fill cpu to apicid and present map in mpparse
This is the way x86_64 does, and complement the already
present patch that does the bios cpu to apicid mapping here

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:01 +02:00
Glauber de Oliveira Costa 73bf102b1c x86: fill bios cpu to apicid maps
We fill the per-cpu (or array) that maps
bios cpu id to apicid in mpparse_32.c, the way x86_64 does

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:01 +02:00
Glauber de Oliveira Costa 4fe29a8564 x86: use specialized routine for setup per-cpu area
We use the same routing as x86_64, moved now to setup.c.
Just with a few ifdefs inside.
Note that this routing uses prefill_possible_map().
It has the very nice side effect of allowing hotplugging of
cpus that are marked as present but disabled by acpi bios.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:01 +02:00
Glauber de Oliveira Costa ccf82085ee x86: initialize map pointers in setup_32.c
this will serve as a reference as to whether or not to
use the per_cpu variables in mpparse. Done the same way
as x86_64

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:00 +02:00
Glauber de Oliveira Costa cbe879fc6c x86: define bios to apicid mapping
This mapping already exists in x86_64, just provide it for
i386

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:00 +02:00
Glauber de Oliveira Costa 8154fa3740 x86: move assignment of CPU_PREPARE before do_boot_cpu
Done to match x86_64

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:00 +02:00
Glauber de Oliveira Costa f3ce4466ab x86: make __smp_prepare_cpu void
We have already removed the only condition that could fail here.
so just don't test for any return value

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:00 +02:00
Glauber de Oliveira Costa f915d7f46b x86: do tests before do_boot_cpu in i386
Do tests before do_boot_cpu in native_cpu_up for i386.
Tests are a little bit broader than originally, and are the
same as x86_64. Test for smp_callin is not applicable right now
and is deferred.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:00 +02:00
Glauber de Oliveira Costa b675f11127 x86: isolate logic to disable smp
Put it in a disable_smp() function, as x86_64 does

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:00 +02:00
Glauber de Oliveira Costa 4780b261e2 x86: isolate sanity checking
Isolate all sanity checking in a smp_sanity_check()
function as x86_64 does.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:00 +02:00
Glauber de Oliveira Costa fa8004d8e0 x86: add barriers statement
goal is to have i386 and x86_64 closer, so we
add barriers to match

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:00 +02:00
Glauber de Oliveira Costa 148a30f8cf x86: use APIC_INTEGRATED tests in x86_64
This patch does not change the behaviour of x86_64, since APIC_INTEGRATED
is always defined as (1). But the code now matches exactly i386 version
(well, this part of the code, at least)

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:00 +02:00
Glauber de Oliveira Costa 5733f62749 x86: move state update out of ipi_lock
it does not need to be inside lock. Do the way i386 does.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:00 +02:00
Glauber de Oliveira Costa 8f15b82e22 x86: move setup_secondary_clock a little bit down in the function
This is done so we call setup_secondary_clock() in the same place x86_64
does. A separate patch for this is appearantly not needed. But clock
initialization is such a delicate thing, that it's safer to do this way

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:00 +02:00
Glauber de Oliveira Costa 3ff8171fee x86: don't call local_irq_enable before entering idle
the call to idle is guaranteed to do it.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:00 +02:00
Glauber de Oliveira Costa 3b22ec7b13 x86: always enable irqs when entering idle
This matches x86_64 behaviour, which is a superior one IMHO

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:00 +02:00
Glauber de Oliveira Costa 1d89a7f072 x86: merge smp_store_cpu_info
now that it is the same between arches, put it into smpboot.c

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:41:00 +02:00
Glauber de Oliveira Costa f7401f7fe6 x86: call identify_secondary_cpu in smp_store_cpu_info
Call it conditionally for secondary cpus. This behaviour
matches i386

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:59 +02:00
Glauber de Oliveira Costa 5745abfe86 x86: use identify_boot_cpu
Call this function instead of identify_cpu in bugs_64.c

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:59 +02:00
Glauber de Oliveira Costa 7a636af664 x86: provide specialized identification routines for x86_64
provide two specialized identify_secondary_cpu() and identify_boot_cpu()
routines for x86_64. Although not strictly needed, they are functionally
correct, and will ease integration with i386

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:59 +02:00
Glauber de Oliveira Costa 4f3ab1959a x86: decouple call to print_cpu_info from smp_store_cpu_info
This will ease integration with i386

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:59 +02:00
Glauber de Oliveira Costa 82389871b8 x86: add an smp_apply_quirks to smpboot_32.c
The split of smp_store_cpu_info in a quirks-only part
will ease integration with x86_64

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:59 +02:00
Glauber de Oliveira Costa d0173aeac4 x86: use start_ipi_hook in x86_64
It is used to match i386. The definition for the non-paravirt
case is moved to smp.h instead of smp_32.h

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:59 +02:00
Glauber de Oliveira Costa 1af8a0c1b3 x86: use apic_*_around instead of apic_write in x86_64
This patch replaces apic_read() for apic_read_around()
and apic_write for apic_write_around() in smpboot_64.c
We do it to have a common usage between x86_64 and i386.
In the former, it will always simply expand to apic_write

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:59 +02:00
Glauber de Oliveira Costa ba10485c2f x86: add loglevel to printks
Add loglevel facilities to printks in __inquire_remote_apic.
the levels are the ones to match x86_64 ones.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:59 +02:00
Glauber de Oliveira Costa 26c6b5ea55 x86: change var types in __inquire_remote_apic
change some variables' types in __inquire_remote_apic to
match x86_64

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:59 +02:00
Pavel Machek b552da8740 x86 iommu: add more documentation
Fix coding style in pci-dma_64.c and add stubs for documentation. I
hope someone fills the rest, I understand maybe off and soft...

Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:59 +02:00
Alexey Starikovskiy 037cab07e9 x86: move mp_bus_id_to_node to numa.c
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:59 +02:00
Alexey Starikovskiy e129cb490e x86: move mp_bus_id_to_local to numa.c
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:59 +02:00
Alexey Starikovskiy c0a282c251 x86: make mp_bus_id_to_type optional
[ mingo@elte.hu: fix boot regression. ]

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:59 +02:00
Alexey Starikovskiy 9e0a2de268 x86: rearrange bus_type parse
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:59 +02:00
Alexey Starikovskiy 643befed10 x86: use not_pci bitmap #6
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:59 +02:00
Alexey Starikovskiy 9c0076cb34 x86: use not_pci bitmap #5
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:59 +02:00
Alexey Starikovskiy 6728801dce x86: use not_pci bitmap #4
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:59 +02:00
Alexey Starikovskiy 47cab822d6 x86: use not_pci bitmap #3
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:59 +02:00
Alexey Starikovskiy 73b2961bfa x86: use not_pci bitmap #2
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:58 +02:00
Alexey Starikovskiy d27e2b8e2a x86: use not_pci bitmap #1
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:58 +02:00
Alexey Starikovskiy a6333c3ccb x86: add mp_bus_not_pci bitmap to mpparse_32.c
Signed-off: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:58 +02:00
Yinghai Lu 8643f9d02a x86: get boot_cpu_id as early for k8_scan_nodes
When acpi=off or there is no SRAT defined, apicid_to_node is got from K8
Northbridge PCI configuration space in k8_scan_nodes() in
arch/x86_64/mm/k8toplogy.c.

The problem is that it assumes bsp apic id is 0 at that point.

For four socket system with Quad core cpus installed, all cpus apic id
is offset by 4, and bsp apic id is 4.

For eight socket system with dual core cpus installed, all cpus apic id
is offset by 2, and bsp apic id is 2.

We need get boot_cpu_id --- bsp apic id, before k8_scan_nodes by called.

So create early_acpi_boot_init and early_get_smp_config for get boot_cpu_id.

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:58 +02:00
Alexey Starikovskiy 6079d2d5d1 x86: move quad_local_to_mp_bus_id to numa.c
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:58 +02:00
Johannes Weiner 1415d160c7 x86: Remove redundant display of free swap space in show_mem()
Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:58 +02:00
Jan Beulich 5b0e508415 x86: prevent unconditional writes to DebugCtl MSR
Otherwise, enabling (or better, subsequent disabling) of single
stepping would cause a kernel oops on CPUs not having this MSR.

The patch could have been added a conditional to the MSR write in
user_disable_single_step(), but centralizing the updates seems safer
and (looking forward) better manageable.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Markus Metzger <markus.t.metzger@intel.com>

Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:58 +02:00
Gautham R Shenoy f694010185 x86: Don't send RESCHEDULE_VECTOR to offlined cpus
In the x86 native_smp_send_reschedule_function(), don't send the IPI if the
cpu has gone offline already. Warn nevertheless!!

Signed-off-by: Gautham R Shenoy <ego@in.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:58 +02:00
Joe Perches e40c0fe6b0 x86: cleanup duplicate includes
Signed-off-by: Joe Perches <joe@perches.com>

 arch/x86/kernel/reboot.c      |    1 -
 include/asm-x86/elf.h         |    5 ++---
 include/asm-x86/posix_types.h |    8 +-------
 include/asm-x86/processor.h   |    3 +--
 include/asm-x86/unistd.h      |    8 +-------
 5 files changed, 5 insertions(+), 20 deletions(-)

Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:58 +02:00
Paolo Ciarrocchi 537d916066 x86: coding style fixes to arch/x86/kernel/setup_32.c
Fix:

  ERROR: do not initialise externals to 0 or NULL

Signed-off-by: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:58 +02:00
Yinghai Lu 9a79cf9c1a x86: sort address_markers for dump_pagetables
otherwise Vmemmap and High Kernel Mapping string is not showing up.

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:58 +02:00
Yinghai Lu 01aaea1afb x86: introduce initial apicid
store initial_apicid from early identify. it is could be different from
phys_proc_id later.

also print it out in /proc/cpuinfo.

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:58 +02:00
Mathieu Desnoyers 4e4eee0e01 x86: enhance DEBUG_RODATA support for hotplug and kprobes
Standardize DEBUG_RODATA, removing special cases for hotplug and kprobes.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: pageexec@freemail.hu
Cc: akpm@linux-foundation.org
CC: Andi Kleen <andi@firstfloor.org>
CC: pageexec@freemail.hu
CC: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2008-04-17 17:40:58 +02:00
Mathieu Desnoyers e587cadd8f x86: enhance DEBUG_RODATA support - alternatives
Fix a memcpy that should be a text_poke (in apply_alternatives).

Use kernel_wp_save/kernel_wp_restore in text_poke to support DEBUG_RODATA
correctly and so the CPU HOTPLUG special case can be removed.

Add text_poke_early, for alternatives and paravirt boot-time and module load
time patching.

Changelog:

- Fix text_set and text_poke alignment check (mixed up bitwise and and or)
- Remove text_set
- Export add_nops, so it can be used by others.
- Document text_poke_early.
- Remove clflush, since it breaks some VIA architectures and is not strictly
  necessary.
- Add kerneldoc to text_poke and text_poke_early.
- Create a second vmap instead of using the WP bit to support Xen and VMI.
- Move local_irq disable within text_poke and text_poke_early to be able to
  be sleepable in these functions.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
CC: Andi Kleen <andi@firstfloor.org>
CC: pageexec@freemail.hu
CC: H. Peter Anvin <hpa@zytor.com>
CC: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:58 +02:00
Harvey Harrison 77bf90ed66 x86: replace remaining __FUNCTION__ occurances
__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:57 +02:00
Yinghai Lu 282bfe21cf x86: show apicid for cpu in proc
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:57 +02:00
Yinghai Lu a706221186 x86: fix amd_detect_cmp
for system with apicid lifting, boot cpu apicid will be 4

got:

  CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
  CPU: L2 Cache: 512K (64 bytes/line)
  CPU 0/4 -> Node 0
  CPU: Physical Processor ID: 1
  CPU: Processor Core ID: 0

so try to offset apicid back before get phys_proc_id with bits shift.
then we can get correct socket ID

also remove remove cpu_data(0) reference.

because cpu_data(0) only be ready after smp_prepare_cpus with the assignment
from boot_cpu_data to current_cpu_data aka cpu_data(0).

and check_bugs()==>identify_cpu(&boot_cpu_data) is quite before than
smp_prepare_cpus. So just use boot_cpu_id instead.

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:57 +02:00
Ingo Molnar 97b44ae6cd x86: add KERN_INFO to show_unhandled_signals printout
Before:
   total: 0 errors, 1 warnings, 678 lines checked
After:
   total: 0 errors, 0 warnings, 678 lines checked

No code changed:

arch/x86/kernel/signal_32.o:

   text	   data	    bss	    dec	    hex	filename
   5333	      0	      4	   5337	   14d9	signal_32.o.before
   5336	      0	      4	   5340	   14dc	signal_32.o.after

md5:
   c279e98012a2808e90cfa2a7787e42a4  signal_32.o.before.asm
   c279e98012a2808e90cfa2a7787e42a4  signal_32.o.after.asm

Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:57 +02:00
Ingo Molnar eee6dd1572 x86: move extern declaration to vdso.h
Before:
   total: 0 errors, 3 warnings, 685 lines checked
After:
   total: 0 errors, 1 warnings, 678 lines checked

No code changed:

arch/x86/kernel/signal_32.o:

   text	   data	    bss	    dec	    hex	filename
   5333	      0	      4	   5337	   14d9	signal_32.o.before
   5333	      0	      4	   5337	   14d9	signal_32.o.after

md5:
   c279e98012a2808e90cfa2a7787e42a4  signal_32.o.before.asm
   c279e98012a2808e90cfa2a7787e42a4  signal_32.o.after.asm

Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:57 +02:00
Ingo Molnar 7e907f4898 x86: clean up arch/x86/kernel/signal_32.c
Before:
   total: 21 errors, 6 warnings, 665 lines checked
After:
   total: 0 errors, 3 warnings, 685 lines checked

No code changed:

arch/x86/kernel/signal_32.o:

   text	   data	    bss	    dec	    hex	filename
   5333	      0	      4	   5337	   14d9	signal_32.o.before
   5333	      0	      4	   5337	   14d9	signal_32.o.after

md5:
   c279e98012a2808e90cfa2a7787e42a4  signal_32.o.before.asm
   c279e98012a2808e90cfa2a7787e42a4  signal_32.o.after.asm

Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:57 +02:00
Ingo Molnar a711317021 x86: remove DEBUG_SIG
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:57 +02:00
Joe Perches c1db29dbc7 x86: arch/x86/kernel/cpu/feature_names.c - use angle brackets for include
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:57 +02:00
Ingo Molnar f668964ea1 x86: clean up i387.c
minor coding style cleanups.

Before:
   total: 0 errors, 3 warnings, 479 lines checked
After:
   total: 0 errors, 1 warnings, 483 lines checked

No code changed:

arch/x86/kernel/i387.o:

   text	   data	    bss	    dec	    hex	filename
   2379	      4	      8	   2391	    957	i387.o.before
   2379	      4	      8	   2391	    957	i387.o.after

md5:
   e1434553a3b4ff1f52ad97a68b1fad8a  i387.o.before.asm
   e1434553a3b4ff1f52ad97a68b1fad8a  i387.o.after.asm

Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:57 +02:00
Glauber Costa e104383fbf x86: use cpu_relax instead of rep_nop
This is done for smpboot_32.c

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:57 +02:00
Glauber Costa e90009bcc1 x86: use wait_for_init_deassert in x86_64
wraps the busy loop for wait_for_init_deasserted() in a function,
so smp_callin in x86_64 looks like more i386

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:57 +02:00
Glauber Costa 91718e8d13 x86: unify setup_trampoline
setup_trampoline() looks very similar between architectures, and this
patch unifies them. The i386 version allocates bootmem memory, while
the x86_64 version uses a fixed address.

In this patch, we initialize the global trampoline_base to the x86_64 version,
and i386 allocation can later override it.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:57 +02:00
Glauber Costa da522b0729 x86: adapt voyager's setup_trampoline
make setup_trampoline non-static. This way, it won't conflict
with the extern declaration in smp.h

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:57 +02:00
Glauber Costa d507897b2f x86: adapt voyager's trampoline_base
Change voyager's trampoline base to unsigned char *
instead of u32. This way, it won't conflict with
the other architectures when including smp.h

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:57 +02:00
Glauber Costa 4206882939 x86: move trampoline arrays extern definition to smp.h
In here, they can serve both architectures

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:56 +02:00
Glauber Costa 89b08200ad x86: make x86_64 accept the max_cpus parameter
The parameter passing parsing is done in the common smpboot.c

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:56 +02:00
Glauber Costa 69c18c15d3 x86: merge __cpu_disable and cpu_die
They are now equal, and are moved to a common file

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:56 +02:00
Glauber Costa e9a6cb96fa x86: do not clear cpu_online_map
it was already cleared two lines above, and so, this removal
is bogus

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:56 +02:00
Glauber Costa 045f9d2202 x86: use remove_from_maps in cpu_disable
it is already used in x86_64. In i386, it only
removes from cpu_online_map

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:56 +02:00
Glauber Costa fc25da9ec6 x86: remove vector_lock around cpu_online_map
This lock does not protect cpu_online_map, so its
length can be shortened, and in some cases, removed.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:56 +02:00
Glauber Costa 70708a18e8 x86: move cpu_coregroup_map to common file
it is equal between architectures

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:56 +02:00
Glauber Costa 768d95051b x86: move sibling functions to common file
set_cpu_sibling_map() and remove_sibling_info() are
equal between architectures, and are now moved to common
file

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:56 +02:00
Glauber Costa 61d5989973 x86: make remove_siblinginfo non-static
this is done to match i386

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:56 +02:00
Glauber Costa 1452207689 x86: make set_cpu_sibling_map nonstatic
And move its extern definition to smp.h, the common header

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-04-17 17:40:56 +02:00