safe/jmp/linux-2.6
16 years agox86: section mismatch fixes, #1
Jacek Luczak [Fri, 11 Apr 2008 11:28:37 +0000 (13:28 +0200)]
x86: section mismatch fixes, #1

This patch fixes mismatch warnings in smp_checks() (in arch/x86/kernel/smpboot.c):

WARNING: arch/x86/kernel/built-in.o(.text+0x11922): Section mismatch in reference from the function smp_checks()
to the variable .cpuinit.data:smp_b_stepping
The function smp_checks() references
the variable __cpuinitdata smp_b_stepping.
This is often because smp_checks lacks a __cpuinitdata
annotation or the annotation of smp_b_stepping is wrong.

Signed-off-by: Jacek Luczak <luczak.jacek@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: fix paranoia about using BIOS quickboot mechanism.
Alok Kataria [Mon, 7 Apr 2008 18:38:33 +0000 (11:38 -0700)]
x86: fix paranoia about using BIOS quickboot mechanism.

> > Make sure that we clear the "shutdown status flag" in the CMOS
> > register after each CPU is brought up.  This fixes a problem where the
> > "shutdown status flag" may remain set when a CPU is brought up after
> > booting.
>
> btw., what problem does this result in, exactly?

The shutdown status flag set to "0xA", corresponds to "JMP double word
request without INT init".

This JMP at reboot time is at an unintended location. And results in
Triple faults in our case.
Though this error at reboot can be safely ignored in a VM environment,
am not sure what the effect would be on a physical system. May be it
will result in a triple fault and an eventual hardware reset thus
masking this BUG in the kernel.

This fix just makes sure that we reset that status flag after
initialization is done.

Fix paranoia about using BIOS quickboot mechanism.

Make sure that we clear the "shutdown status flag" in the CMOS register
after each CPU is brought up.  This fixes a problem where the "shutdown
status flag" may remain set when a CPU is brought up after booting.

Signed-off-by: Alok N Kataria <akataria@vmware.com>
Signed-off-by: Dan Arai <arai@vmware.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: print out buggy mptable
Yinghai Lu [Mon, 7 Apr 2008 18:36:39 +0000 (11:36 -0700)]
x86: print out buggy mptable

print out buggy mptable, instead of skipping it quietly

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: use cpu_online()
Akinobu Mita [Sat, 5 Apr 2008 13:39:09 +0000 (22:39 +0900)]
x86: use cpu_online()

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: use cpumask_of_cpu()
Akinobu Mita [Sat, 5 Apr 2008 13:39:08 +0000 (22:39 +0900)]
x86: use cpumask_of_cpu()

Use cpumask_of_cpu() rather than the pair of cpus_clear() and cpu_set().

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: remove unnecessary tmp local variable
Akinobu Mita [Sat, 5 Apr 2008 13:39:07 +0000 (22:39 +0900)]
x86: remove unnecessary tmp local variable

There is no reason to use obscurer name.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: remove unnecessary memset()
Akinobu Mita [Sat, 5 Apr 2008 13:39:06 +0000 (22:39 +0900)]
x86: remove unnecessary memset()

No need to clear the memory allocated by alloc_bootmem().
It is already filled with zero.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: use ioapic_read_entry() and ioapic_write_entry()
Akinobu Mita [Sat, 5 Apr 2008 13:39:05 +0000 (22:39 +0900)]
x86: use ioapic_read_entry() and ioapic_write_entry()

Remove duplicate code by using ioapic_read_entry() and ioapic_write_entry()
in io_apic_{32,64}.c

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: avoid redundant loop in io_apic_level_ack_pending()
Akinobu Mita [Sat, 5 Apr 2008 13:39:04 +0000 (22:39 +0900)]
x86: avoid redundant loop in io_apic_level_ack_pending()

If one can find an ack pending pin, there is no need to check
the rest of them.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: remove superfluous initialisation in boot code.
Alexander van Heukelum [Sun, 6 Apr 2008 12:47:00 +0000 (14:47 +0200)]
x86: remove superfluous initialisation in boot code.

In arch/x86/boot/compressed/misc.c, the variable vidmem is
the only variable that ends up in de data segment. It's also
superfluous, because the first thing the code does is:

if (RM_SCREEN_INFO.orig_video_mode == 7) {
vidmem = (char *) 0xb0000;
vidport = 0x3b4;
} else {
vidmem = (char *) 0xb8000;
vidport = 0x3d4;
}

This patch removes the initialisation.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: merge mpparse_{32,64}.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:43:18 +0000 (23:43 +0400)]
x86: merge mpparse_{32,64}.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: unify mp_register_gsi
Alexey Starikovskiy [Fri, 4 Apr 2008 19:43:12 +0000 (23:43 +0400)]
x86: unify mp_register_gsi

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: unify mp_config_acpi_legacy_irqs
Alexey Starikovskiy [Fri, 4 Apr 2008 19:43:06 +0000 (23:43 +0400)]
x86: unify mp_config_acpi_legacy_irqs

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: unify mp_register_ioapic
Alexey Starikovskiy [Fri, 4 Apr 2008 19:43:00 +0000 (23:43 +0400)]
x86: unify mp_register_ioapic

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: unify uniq_io_apic_id
Alexey Starikovskiy [Fri, 4 Apr 2008 19:42:53 +0000 (23:42 +0400)]
x86: unify uniq_io_apic_id

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: unify smp_scan_config
Alexey Starikovskiy [Fri, 4 Apr 2008 19:42:46 +0000 (23:42 +0400)]
x86: unify smp_scan_config

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: unify get_smp_config
Alexey Starikovskiy [Fri, 4 Apr 2008 19:42:40 +0000 (23:42 +0400)]
x86: unify get_smp_config

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: unify construct_default_ioirq_mptable
Alexey Starikovskiy [Fri, 4 Apr 2008 19:42:34 +0000 (23:42 +0400)]
x86: unify construct_default_ioirq_mptable

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: unify smp_read_mpc
Alexey Starikovskiy [Fri, 4 Apr 2008 19:42:27 +0000 (23:42 +0400)]
x86: unify smp_read_mpc

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: unify mp_bus_info
Alexey Starikovskiy [Fri, 4 Apr 2008 19:42:21 +0000 (23:42 +0400)]
x86: unify mp_bus_info

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: unify arch/x86/kernel/mpparse_64.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:42:15 +0000 (23:42 +0400)]
x86: unify arch/x86/kernel/mpparse_64.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: add early flags to mpparse_32.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:42:09 +0000 (23:42 +0400)]
x86: add early flags to mpparse_32.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: lindent mpparse_32.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:42:03 +0000 (23:42 +0400)]
x86: lindent mpparse_32.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move mp_register_lapic_address to boot.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:41:57 +0000 (23:41 +0400)]
x86: move mp_register_lapic_address to boot.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move mp_register_lapic to boot.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:41:50 +0000 (23:41 +0400)]
x86: move mp_register_lapic to boot.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move up & smp variables to setup.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:41:44 +0000 (23:41 +0400)]
x86: move up & smp variables to setup.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move mp_irqs to io_apic_64.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:41:38 +0000 (23:41 +0400)]
x86: move mp_irqs to io_apic_64.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move mp_irqs to io_apics_32.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:41:32 +0000 (23:41 +0400)]
x86: move mp_irqs to io_apics_32.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move mp_ioapic_routing to boot.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:41:26 +0000 (23:41 +0400)]
x86: move mp_ioapic_routing to boot.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move mp_ioapics to io_apic_64.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:41:19 +0000 (23:41 +0400)]
x86: move mp_ioapics to io_apic_64.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move mp_ioapics to io_apic_32.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:41:13 +0000 (23:41 +0400)]
x86: move mp_ioapics to io_apic_32.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: don't set io apic features if io-apic is not enabled, fix
Ingo Molnar [Mon, 7 Apr 2008 11:11:09 +0000 (13:11 +0200)]
x86: don't set io apic features if io-apic is not enabled, fix

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: don't set IO APIC features if IO APIC is not enabled
Alexey Starikovskiy [Fri, 4 Apr 2008 19:41:07 +0000 (23:41 +0400)]
x86: don't set IO APIC features if IO APIC is not enabled

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move x86_bios_cpu_apicid_init to smpboot.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:41:00 +0000 (23:41 +0400)]
x86: move x86_bios_cpu_apicid_init to smpboot.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move x86_cpu_to_apicid_init to smpboot.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:40:54 +0000 (23:40 +0400)]
x86: move x86_cpu_to_apicid_init to smpboot.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move phys_cpu_present_map to setup.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:40:48 +0000 (23:40 +0400)]
x86: move phys_cpu_present_map to setup.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move x86_cpu_to_apicid to setup.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:40:41 +0000 (23:40 +0400)]
x86: move x86_cpu_to_apicid to setup.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move x86_bios_cpu_apicid to io_apic_64.c
Alexey Starikovskiy [Fri, 4 Apr 2008 19:40:32 +0000 (23:40 +0400)]
x86: move x86_bios_cpu_apicid to io_apic_64.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: 4kstacks default
Ingo Molnar [Fri, 4 Apr 2008 15:11:09 +0000 (17:11 +0200)]
x86: 4kstacks default

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: fix VisualWS and Voyager kexec build failures
Randy Dunlap [Tue, 1 Apr 2008 22:44:01 +0000 (15:44 -0700)]
x86: fix VisualWS and Voyager kexec build failures

without this patch:

VOYAGER:
kernel/built-in.o: In function `crash_kexec':
(.text+0x28588): undefined reference to `machine_crash_shutdown'

VISWS:
kernel/built-in.o: In function `crash_kexec':
/next-20080401/kernel/kexec.c:1074: undefined reference to `machine_crash_shutdown'
make[1]: *** [.tmp_vmlinux1] Error 1

because arch/x86/kernel/reboot.c isn't built since CONFIG_X86_BIOS_REBOOT=n,
so machine_crash_shutdown() isn't available.

This patch does seem a small bit odd since the KEXEC help text says that
kexec is independent of the system firmware.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: MPSC should use P6 NOPs
Hugh Dickins [Thu, 3 Apr 2008 22:48:29 +0000 (23:48 +0100)]
x86: MPSC should use P6 NOPs

I've now noticed that the machine I call MPENTIUM4 for 32-bit kernels
is called MPSC for 64-bit kernels, and in that case it still doesn't
get the P6 NOPs it ought to.  hpa explains that MK8 should still be
excluded, so it's just a matter of including MPSC along with MPENTIUM4.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: debug Store - call kfree if only we really need it
Cyrill Gorcunov [Tue, 1 Apr 2008 15:41:50 +0000 (19:41 +0400)]
x86: debug Store - call kfree if only we really need it

We should call for kfree if only we really need it.
Though it's safe to call kfree with NULL pointer passed
in this code we've already tested the pointer and can
eliminate the call

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: extend the scheduled bzImage symlinks removal
Ingo Molnar [Thu, 10 Apr 2008 08:12:27 +0000 (10:12 +0200)]
x86: extend the scheduled bzImage symlinks removal

use of the bzImage symlinks in developer scripts is still widespread,
so lets extend the removal period by 2 years. These symlinks cost
us near nothing.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: improve default idle
Ingo Molnar [Wed, 2 Apr 2008 11:23:22 +0000 (13:23 +0200)]
x86: improve default idle

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: support for new UV apic, fix
Jack Steiner [Mon, 31 Mar 2008 02:02:07 +0000 (21:02 -0500)]
x86: support for new UV apic, fix

Yinghai Lu pointed out a bug in the previous patches,
fix double-shift of apicid.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: set_cyc2ns_scale() remove prev scale
Ingo Molnar [Mon, 31 Mar 2008 12:52:15 +0000 (14:52 +0200)]
x86: set_cyc2ns_scale() remove prev scale

Peter Zijlstra pointed out that it's unused.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: clean up non-smp usage of cpu maps
Mike Travis [Tue, 25 Mar 2008 22:06:51 +0000 (15:06 -0700)]
x86: clean up non-smp usage of cpu maps

Cleanup references to the early cpu maps for the non-SMP configuration
and remove some functions called for SMP configurations only.

Cc: Andi Kleen <ak@suse.de>
Cc: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Mike Travis <travis@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: uv fix
Ingo Molnar [Sun, 30 Mar 2008 10:17:12 +0000 (12:17 +0200)]
x86: uv fix

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: support for new UV apic
Jack Steiner [Fri, 28 Mar 2008 19:12:16 +0000 (14:12 -0500)]
x86: support for new UV apic

UV supports really big systems. So big, in fact, that the APICID register
does not contain enough bits to contain an APICID that is unique across all
cpus.

The UV BIOS supports 3 APICID modes:

- legacy mode. This mode uses the old APIC mode where
  APICID is in bits [31:24] of the APICID register.

- x2apic mode. This mode is whitebox-compatible. APICIDs
  are unique across all cpus. Standard x2apic APIC operations
  (Intel-defined) can be used for IPIs. The node identifier
  fits within the Intel-defined portion of the APICID register.

- x2apic-uv mode. In this mode, the APICIDs on each node have
  unique IDs, but IDs on different node are not unique. For example,
  if each mode has 32 cpus, the APICIDs on each node might be
  0 - 31. Every node has the same set of IDs.
  The UV hub is used to route IPIs/interrupts to the correct node.
  Traditional APIC operations WILL NOT WORK.

In x2apic-uv mode, the ACPI tables all contain a full unique ID (note:
exact bit layout still changing but the following is close):

nnnnnnnnnnlc0cch
n = unique node number
l = socket number on board
c = core
h = hyperthread

Only the "lc0cch" bits are written to the APICID register. The remaining bits are
supplied by having the get_apic_id() function "OR" the extra bits into the value
read from the APICID register. (Hmmm.. why not keep the ENTIRE APICID register
in per-cpu data....)

The x2apic-uv mode is recognized by the MADT table containing:
  oem_id = "SGI"
  oem_table_id = "UV-X"

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: support for new UV apic, prepare
Ingo Molnar [Tue, 8 Apr 2008 10:20:50 +0000 (12:20 +0200)]
x86: support for new UV apic, prepare

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: define the macros and tables for blade functions
Jack Steiner [Fri, 28 Mar 2008 19:12:14 +0000 (14:12 -0500)]
x86: define the macros and tables for blade functions

Add UV macros for converting between cpu numbers, blade numbers
and node numbers. Note that these are used ONLY within x86_64 UV
modules, and are not for general kernel use.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: define the macros and tables for the basic UV infrastructure.
Jack Steiner [Fri, 28 Mar 2008 19:12:13 +0000 (14:12 -0500)]
x86: define the macros and tables for the basic UV infrastructure.

Define the macros and tables for the basic UV infrastructure.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: add UV specific header for MMR definitions
Jack Steiner [Fri, 28 Mar 2008 19:12:11 +0000 (14:12 -0500)]
x86: add UV specific header for MMR definitions

Definitions of UV MMRs.
Note: this file is auto-generated by hardware design tools.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: parsing for ACPI "SAPIC" table
Jack Steiner [Fri, 28 Mar 2008 19:12:09 +0000 (14:12 -0500)]
x86: parsing for ACPI "SAPIC" table

Add kernel support for new ACPI "sapic" tables that contain 16-bit APICIDs.
This patch simply adds parsing of an optional SAPIC table if present.
Otherwise, the traditional local APIC table is used.

Note: the SAPIC table is not a new ACPI table - it exists on other architectures
but is not currently recognized by x86_64.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: increase size of APICID
Jack Steiner [Fri, 28 Mar 2008 19:12:08 +0000 (14:12 -0500)]
x86: increase size of APICID

Increase the number of bits in an apicid from 8 to 32.

By default, MP_processor_info() gets the APICID from the
mpc_config_processor structure. However, this structure limits
the size of APICID to 8 bits. This patch allows the caller of
MP_processor_info() to optionally pass a larger APICID that will
be used instead of the one in the mpc_config_processor struct.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: add functions to determine if platform is a UV platform
Jack Steiner [Fri, 28 Mar 2008 19:12:06 +0000 (14:12 -0500)]
x86: add functions to determine if platform is a UV platform

Add functions that can be used to determine if an x86_64
system is a SGI "UV" system. UV systems come in 3 types and
are identified by the OEM ID in the MADT.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: change GET_APIC_ID() from an inline function to an out-of-line function
Jack Steiner [Fri, 28 Mar 2008 19:12:02 +0000 (14:12 -0500)]
x86: change GET_APIC_ID() from an inline function to an out-of-line function

Introduce a function to read the local APIC_ID.

This change is in preparation for additional changes to
the APICID functions that will come in a later patch.

Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: replace most VM86 flags with flags from processor-flags.h
gorcunov@gmail.com [Fri, 28 Mar 2008 14:56:56 +0000 (17:56 +0300)]
x86: replace most VM86 flags with flags from processor-flags.h

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: cleanup - rename VM_MASK to X86_VM_MASK
gorcunov@gmail.com [Fri, 28 Mar 2008 14:56:57 +0000 (17:56 +0300)]
x86: cleanup - rename VM_MASK to X86_VM_MASK

This patch renames VM_MASK to X86_VM_MASK (which
in turn defined as alias to X86_EFLAGS_VM) to better
distinguish from virtual memory flags. We can't just
use X86_EFLAGS_VM instead because it is also used
for conditional compilation

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: cleanup replace most vm86 flags with flags from processor-flags.h, fix
Ingo Molnar [Sun, 30 Mar 2008 09:45:23 +0000 (11:45 +0200)]
x86: cleanup replace most vm86 flags with flags from processor-flags.h, fix

- fix build error
- fix CONFIG_HEADERS_CHECK error

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: paravirt_ops: don't steal memory resources in paravirt_disable_iospace
Jeremy Fitzhardinge [Fri, 28 Mar 2008 00:28:40 +0000 (17:28 -0700)]
x86: paravirt_ops: don't steal memory resources in paravirt_disable_iospace

The memory resource is also used for main memory, and we need it to
allocate physical addresses for memory hotplug.  Knobbling io space is
enough to get the job done anyway.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: sparsemem: reduce i386 PAE section size
Jeremy Fitzhardinge [Fri, 28 Mar 2008 00:28:39 +0000 (17:28 -0700)]
x86: sparsemem: reduce i386 PAE section size

A 1G section size makes memory hotplug too coarse in a virtual
environment.  Retuce it by a factor of 2 to 512M.  I would have liked
to make it smaller, but it runs out of reserved flags in the page flags.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Yasunori Goto <y-goto@jp.fujitsu.com>
Cc: Christoph Lameter <clameter@sgi.com>
Cc: Dave Hansen <dave@linux.vnet.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: mpparse: 64-bit fix
Ingo Molnar [Fri, 28 Mar 2008 11:33:52 +0000 (12:33 +0100)]
x86: mpparse: 64-bit fix

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: merge smp_32.h and smp_64.h into smp.h
Glauber Costa [Thu, 27 Mar 2008 17:06:04 +0000 (14:06 -0300)]
x86: merge smp_32.h and smp_64.h into smp.h

Merge what's left from smp_32.h and smp_64.h into smp.h
By now, they're basically extern definitions.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: change naming of cpu_initialized_mask for xen
Glauber Costa [Thu, 27 Mar 2008 17:06:03 +0000 (14:06 -0300)]
x86: change naming of cpu_initialized_mask for xen

xen does not use the global cpu_initialized mask, but rather,
a specific one. So we change its name so it won't conflict with the upcoming
movement of cpu_initialized_mask from smp_64.h to smp_32.h.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
CC: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: merge SMP definitions of smp.h
Glauber Costa [Thu, 27 Mar 2008 17:06:02 +0000 (14:06 -0300)]
x86: merge SMP definitions of smp.h

we merge everything that is inside CONFIG_SMP
to smp.h. They differ a little bit, so we use
CONFIG_X86_32_SMP and CONFIG_X86_64_SMP as markers.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: split safe_smp_processor_id
Glauber Costa [Thu, 27 Mar 2008 17:06:01 +0000 (14:06 -0300)]
x86: split safe_smp_processor_id

This implementation in x86_64 is clean and consistent, but we
sacrifice it for the sake of being equal to i386 (since the other
way around would be harder).

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: merge includes in smp.h
Glauber Costa [Thu, 27 Mar 2008 17:06:00 +0000 (14:06 -0300)]
x86: merge includes in smp.h

move all include directives from smp_{32,64}.h to smp.h.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: surround apic headers in apic definitions
Glauber Costa [Thu, 27 Mar 2008 17:05:59 +0000 (14:05 -0300)]
x86: surround apic headers in apic definitions

Although those constants are always defined in x86_64,
and will have the effect of just including the headers
in the very way we did before, I'm doing this in a separate
patch to be conservative and avoid surprises.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: merge hard/logical_smp_processor_id
Glauber Costa [Thu, 27 Mar 2008 17:05:58 +0000 (14:05 -0300)]
x86: merge hard/logical_smp_processor_id

The code is now the same between i386 and x86_64. We already
know what happens when it reaches this point: They go away
from the arch-specific headers, and suddenly appears in the common
header.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: provide bogus hard_smp_processor_id
Glauber Costa [Thu, 27 Mar 2008 17:05:57 +0000 (14:05 -0300)]
x86: provide bogus hard_smp_processor_id

We provide a bogus macro for x86_64 in case CONFIG_X86_LOCAL_APIC
is not set. It will always be set for x86_64, so the effect
is just to make the code equal to i386.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: surround hard_smp_processor_id in APIC_DEFINITION
Glauber Costa [Thu, 27 Mar 2008 17:05:56 +0000 (14:05 -0300)]
x86: surround hard_smp_processor_id in APIC_DEFINITION

APIC_DEFINITION is not defined in x86_64, so in practice, we keep
our old code here. But as a nice side effect, the code is now
equal to smp_32.h.

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: microcode: show results on success too
Ben Castricum [Thu, 27 Mar 2008 19:52:35 +0000 (20:52 +0100)]
x86: microcode: show results on success too

Report when microcode was successfully updated. It used to be there but
now with DEBUG unset it becomes very silent. Also some cosmetic fixes.

Signed-off-by: Ben Castricum <lk08@bencastricum.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move generic_processor_info to apic_64.c
Alexey Starikovskiy [Thu, 27 Mar 2008 20:56:19 +0000 (23:56 +0300)]
x86: move generic_processor_info to apic_64.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move boot_cpu_physical_apicid to apic_64.c
Alexey Starikovskiy [Thu, 27 Mar 2008 20:56:12 +0000 (23:56 +0300)]
x86: move boot_cpu_physical_apicid to apic_64.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move disabled_cpus to smpboot.c (64bit)
Alexey Starikovskiy [Thu, 27 Mar 2008 20:56:06 +0000 (23:56 +0300)]
x86: move disabled_cpus to smpboot.c (64bit)

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move num_processors to smpboot.c (64 bit)
Alexey Starikovskiy [Thu, 27 Mar 2008 20:55:59 +0000 (23:55 +0300)]
x86: move num_processors to smpboot.c (64 bit)

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move phys_cpu_present_map to smpboot.c (64bit)
Alexey Starikovskiy [Thu, 27 Mar 2008 20:55:53 +0000 (23:55 +0300)]
x86: move phys_cpu_present_map to smpboot.c (64bit)

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move phys cpu present map to smpboot.c, 64-bit, prepare
Ingo Molnar [Tue, 8 Apr 2008 10:20:07 +0000 (12:20 +0200)]
x86: move phys cpu present map to smpboot.c, 64-bit, prepare

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move mp_lapic_addr to apic_64.c
Alexey Starikovskiy [Thu, 27 Mar 2008 20:55:47 +0000 (23:55 +0300)]
x86: move mp_lapic_addr to apic_64.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: don't use MP_processor_info for ACPI mode (64bit)
Alexey Starikovskiy [Thu, 27 Mar 2008 20:55:41 +0000 (23:55 +0300)]
x86: don't use MP_processor_info for ACPI mode (64bit)

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: separate generic_processor_info into its own function (64bit)
Alexey Starikovskiy [Thu, 27 Mar 2008 20:55:34 +0000 (23:55 +0300)]
x86: separate generic_processor_info into its own function (64bit)

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: don't call MP_processor_info for disabled cpu (64bit)
Alexey Starikovskiy [Thu, 27 Mar 2008 20:55:28 +0000 (23:55 +0300)]
x86: don't call MP_processor_info for disabled cpu (64bit)

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: mpparse, move generic processor info to apic_32.c fix
Ingo Molnar [Fri, 28 Mar 2008 10:59:57 +0000 (11:59 +0100)]
x86: mpparse, move generic processor info to apic_32.c fix

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move generic_processor_info to apic_32.c
Alexey Starikovskiy [Thu, 27 Mar 2008 20:55:22 +0000 (23:55 +0300)]
x86: move generic_processor_info to apic_32.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move x86_bios_cpu_apicid to apic_32.c
Alexey Starikovskiy [Thu, 27 Mar 2008 20:55:16 +0000 (23:55 +0300)]
x86: move x86_bios_cpu_apicid to apic_32.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: mpparse, move boot cpu physical apicid to apic_32.c, fix
Ingo Molnar [Fri, 28 Mar 2008 11:22:10 +0000 (12:22 +0100)]
x86: mpparse, move boot cpu physical apicid to apic_32.c, fix

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move boot_cpu_physical_apicid to apic_32.c
Alexey Starikovskiy [Thu, 27 Mar 2008 20:55:10 +0000 (23:55 +0300)]
x86: move boot_cpu_physical_apicid to apic_32.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move def_to_bigsmp to setup_32.c
Alexey Starikovskiy [Thu, 27 Mar 2008 20:55:04 +0000 (23:55 +0300)]
x86: move def_to_bigsmp to setup_32.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: mpparse, move disabled cpus to smpboot.c, fix
Ingo Molnar [Fri, 28 Mar 2008 10:57:55 +0000 (11:57 +0100)]
x86: mpparse, move disabled cpus to smpboot.c, fix

Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move disabled_cpus to smpboot.c
Alexey Starikovskiy [Thu, 27 Mar 2008 20:54:57 +0000 (23:54 +0300)]
x86: move disabled_cpus to smpboot.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move num_processors to smpboot.c
Alexey Starikovskiy [Thu, 27 Mar 2008 20:54:50 +0000 (23:54 +0300)]
x86: move num_processors to smpboot.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move phys_cpu_present_map to smpboot.c
Alexey Starikovskiy [Thu, 27 Mar 2008 20:54:44 +0000 (23:54 +0300)]
x86: move phys_cpu_present_map to smpboot.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move mp_lapic_addr to apic_32.c
Alexey Starikovskiy [Thu, 27 Mar 2008 20:54:38 +0000 (23:54 +0300)]
x86: move mp_lapic_addr to apic_32.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move apic_ver array to apic_32.c
Alexey Starikovskiy [Thu, 27 Mar 2008 20:54:31 +0000 (23:54 +0300)]
x86: move apic_ver array to apic_32.c

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: don't use MP_processor_info for ACPI mode
Alexey Starikovskiy [Thu, 27 Mar 2008 20:54:20 +0000 (23:54 +0300)]
x86: don't use MP_processor_info for ACPI mode

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: separate generic_processor_info into its own function
Alexey Starikovskiy [Thu, 27 Mar 2008 20:54:13 +0000 (23:54 +0300)]
x86: separate generic_processor_info into its own function

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: don't call MP_processor_info for disabled cpu
Alexey Starikovskiy [Thu, 27 Mar 2008 20:54:06 +0000 (23:54 +0300)]
x86: don't call MP_processor_info for disabled cpu

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: move es7000_plat closer to its user
Alexey Starikovskiy [Thu, 27 Mar 2008 20:53:54 +0000 (23:53 +0300)]
x86: move es7000_plat closer to its user

Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
16 years agox86: add comments to describe the new api's in cacheflush.h
Arjan van de Ven [Thu, 17 Apr 2008 15:41:31 +0000 (17:41 +0200)]
x86: add comments to describe the new api's in cacheflush.h

The new cacheflush.h API's didn't have any comments describing
how they're to be used yet and the conventions around these functions.
This patch adds comments to this effect; in order for that to be
a logical series, some prototypes had to move around.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>