Commit Graph

1005 Commits

Author SHA1 Message Date
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
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
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
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