GitHub/moto-9609/android_kernel_motorola_exynos9610.git
15 years agox86/Voyager: remove APIC/IO-APIC Kbuild quirk
Ingo Molnar [Tue, 27 Jan 2009 16:40:48 +0000 (17:40 +0100)]
x86/Voyager: remove APIC/IO-APIC Kbuild quirk

The lapic/ioapic code properly auto-detects and is safe to run on CPUs that
have no local APIC. (or which have their lapic turned off in the hardware)

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86/Voyager: remove PARAVIRT Kconfig quirk
Ingo Molnar [Tue, 27 Jan 2009 16:38:46 +0000 (17:38 +0100)]
x86/Voyager: remove PARAVIRT Kconfig quirk

Remove this Kconfig quirk:

 config PARAVIRT
  bool "Enable paravirtualization code"
depends on !X86_VOYAGER
  help

Voyager support built into a kernel does not preclude paravirt support.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86/Voyager: remove KVM_GUEST quirk
Ingo Molnar [Tue, 27 Jan 2009 16:37:33 +0000 (17:37 +0100)]
x86/Voyager: remove KVM_GUEST quirk

Voyager has this quirk currently:

 config KVM_GUEST
  bool "KVM Guest support"
  select PARAVIRT
depends on !X86_VOYAGER

Voyager support built into a kernel image does not exclude
KVM paravirt guest support - so remove this quirk.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86/Voyager: remove KVM_CLOCK quirk
Ingo Molnar [Tue, 27 Jan 2009 16:36:31 +0000 (17:36 +0100)]
x86/Voyager: remove KVM_CLOCK quirk

Voyager has this build-time quirk to exclude KVM_CLOCK:

  bool "KVM paravirtualized clock"
  select PARAVIRT
  select PARAVIRT_CLOCK
depends on !X86_VOYAGER

Voyager support built into a kernel image does not exclude
KVM paravirt clock support - so remove this quirk.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86/Voyager: remove VMI Kconfig quirk
Ingo Molnar [Tue, 27 Jan 2009 16:34:56 +0000 (17:34 +0100)]
x86/Voyager: remove VMI Kconfig quirk

x86/Voyager has this build-time quirk:

  bool "VMI Guest support"
  select PARAVIRT
  depends on X86_32
depends on !X86_VOYAGER

Since VMI is auto-detected (and Voyager will be auto-detected) there's no
reason for this quirk.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86/VisWS: remove Kconfig quirk
Ingo Molnar [Tue, 27 Jan 2009 16:33:34 +0000 (17:33 +0100)]
x86/VisWS: remove Kconfig quirk

VisWS has this quirk currently:

 config X86_VISWS
  bool "SGI 320/540 (Visual Workstation)"
depends on X86_32 && PCI && !X86_VOYAGER && X86_MPPARSE && PCI_GODIRECT

The !Voyager quirk is unnecessary.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86/Voyager: remove X86_FIND_SMP_CONFIG Kconfig quirk
Ingo Molnar [Tue, 27 Jan 2009 16:28:08 +0000 (17:28 +0100)]
x86/Voyager: remove X86_FIND_SMP_CONFIG Kconfig quirk

x86/Voyager had this Kconfig quirk:

 config X86_FIND_SMP_CONFIG
def_bool y
depends on X86_MPPARSE || X86_VOYAGER

Which splits off the find_smp_config() callback into a build-time quirk.

Voyager should use the existing x86_quirks.mach_find_smp_config() callback
to introduce SMP-config quirks. NUMAQ-32 and VISWS already use this.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86/Voyager: remove X86_BIOS_REBOOT Kconfig quirk
Ingo Molnar [Tue, 27 Jan 2009 16:17:55 +0000 (17:17 +0100)]
x86/Voyager: remove X86_BIOS_REBOOT Kconfig quirk

Voyager has this Kconfig quirk:

config X86_BIOS_REBOOT
bool
depends on !X86_VOYAGER
default y

Voyager should use the existing machine_ops.emergency_restart reboot
quirk mechanism instead of a build-time quirk.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86/Voyager: remove X86_HT Kconfig quirk
Ingo Molnar [Tue, 27 Jan 2009 16:16:16 +0000 (17:16 +0100)]
x86/Voyager: remove X86_HT Kconfig quirk

Voyager has this Kconfig quirk:

depends on (X86_32 && !X86_VOYAGER) || X86_64

That is unnecessary as HT support is CPUID driven and explicitly
 enumerated.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: generalize boot_cpu_id
Ingo Molnar [Tue, 27 Jan 2009 16:13:05 +0000 (17:13 +0100)]
x86: generalize boot_cpu_id

x86/Voyager can boot on non-zero processors. While that can probably
be fixed by properly remapping the physical CPU IDs, keep boot_cpu_id
for now for easier transition - and expand it to all of x86.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: replace CONFIG_X86_SMP with CONFIG_SMP
Ingo Molnar [Tue, 27 Jan 2009 16:07:08 +0000 (17:07 +0100)]
x86: replace CONFIG_X86_SMP with CONFIG_SMP

The x86/Voyager subarch used to have this distinction between
 'x86 SMP support' and 'Voyager SMP support':

 config X86_SMP
bool
depends on SMP && ((X86_32 && !X86_VOYAGER) || X86_64)

This is a pointless distinction - Voyager can (and already does) use
smp_ops to implement various SMP quirks it has - and it can be extended
more to cover all the specialities of Voyager.

So remove this complication in the Kconfig space.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86/Voyager: remove ARCH_SUSPEND_POSSIBLE Kconfig quirk
Ingo Molnar [Tue, 27 Jan 2009 16:04:39 +0000 (17:04 +0100)]
x86/Voyager: remove ARCH_SUSPEND_POSSIBLE Kconfig quirk

Voyager has this Kconfig quirk for suspend/resume:

 config ARCH_SUSPEND_POSSIBLE
  def_bool y
  depends on !X86_VOYAGER

The proper mechanism to not suspend on a piece of hardware to disable
CONFIG_SUSPEND. Remove the quirk.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86/Voyager: remove HIBERNATION Kconfig quirk
Ingo Molnar [Tue, 27 Jan 2009 16:03:24 +0000 (17:03 +0100)]
x86/Voyager: remove HIBERNATION Kconfig quirk

Voyager has this hibernation quirk:

 config ARCH_HIBERNATION_POSSIBLE
  def_bool y
depends on !SMP || !X86_VOYAGER

Hibernation is a generic facility provided on all x86 platforms. If it
is buggy on Voyager then that bug should be fixed - not worked around.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86/Voyager: remove KGDB Kconfig quirk
Ingo Molnar [Tue, 27 Jan 2009 16:02:29 +0000 (17:02 +0100)]
x86/Voyager: remove KGDB Kconfig quirk

x86/Voyager has this KGDB quirk:

select HAVE_ARCH_KGDB if !X86_VOYAGER

This is completely pointless - there's nothing in KGDB that cannot work
on Voyager. Remove it.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86/Voyager: remove KVM Kconfig quirk
Ingo Molnar [Tue, 27 Jan 2009 16:01:14 +0000 (17:01 +0100)]
x86/Voyager: remove KVM Kconfig quirk

Voyager and other subarchitectures have this Kconfig quirk:

  select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64)

This is unnecessary, as KVM cleanly detects based on CPUID capabilities.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86/Voyager: remove NATSEMI Kconfig quirk
Ingo Molnar [Tue, 27 Jan 2009 15:59:11 +0000 (16:59 +0100)]
x86/Voyager: remove NATSEMI Kconfig quirk

x86/Voyager has this quirk for SCx200 support:

 config SCx200
  tristate "NatSemi SCx200 support"
depends on !X86_VOYAGER

Remove it - Voyager users can disable drivers they dont need.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86/Voyager: remove MCA Kconfig quirk
Ingo Molnar [Tue, 27 Jan 2009 15:57:49 +0000 (16:57 +0100)]
x86/Voyager: remove MCA Kconfig quirk

Remove Voyager Kconfig quirk: just like any other hardware platform
users of Voyager systems can configure in the hardware drivers they need.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: disable Voyager temporarily
Ingo Molnar [Wed, 28 Jan 2009 18:55:34 +0000 (19:55 +0100)]
x86: disable Voyager temporarily

x86/Voyager does not build right now and it's unclear whether it will
be cleaned up and ported to the subarch-less 32-bit x86 code - so disable
it for now.

If it's fixed we'll re-enable it - or remove it after some time. There's
a very low number of systems running development kernels on x86/Voyager
currently. (one or two on the whole planet)

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86/Voyager: clean up BROKEN Kconfig reference
Ingo Molnar [Tue, 27 Jan 2009 16:54:17 +0000 (17:54 +0100)]
x86/Voyager: clean up BROKEN Kconfig reference

CONFIG_BROKEN has been removed from the upstream kernel years ago,
but X86_VOYAGER still had a stale reference to it - remove it.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: remove subarchitecture support
Ingo Molnar [Wed, 28 Jan 2009 18:32:55 +0000 (19:32 +0100)]
x86: remove subarchitecture support

Remove the 32-bit subarchitecture support code.

All subarchitectures but Voyager have been converted. Voyager will be
done later or will be removed.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: move mach-default/*.h files to asm/
Ingo Molnar [Wed, 28 Jan 2009 18:34:09 +0000 (19:34 +0100)]
x86: move mach-default/*.h files to asm/

We are getting rid of subarchitecture support - move the hook files
to asm/. (These are now stale and should be replaced with more explicit
runtime mechanisms - but the transition is simpler this way.)

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: remove subarchitecture support code
Ingo Molnar [Wed, 28 Jan 2009 18:11:44 +0000 (19:11 +0100)]
x86: remove subarchitecture support code

Remove remaining bits of the subarchitecture code. Now that all the
special platforms are runtime probed and runtime handled, we can remove
these facilities.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, smp: remove mach_ipi.h
Ingo Molnar [Wed, 28 Jan 2009 18:14:52 +0000 (19:14 +0100)]
x86, smp: remove mach_ipi.h

Move mach_ipi.h definitions into genapic.h.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, bigsmp: consolidate header code
Ingo Molnar [Wed, 28 Jan 2009 18:19:12 +0000 (19:19 +0100)]
x86, bigsmp: consolidate header code

Move all the asm/bigsmp/*.h definitions into bigsmp_32.c.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, bigsmp: consolidate code
Ingo Molnar [Wed, 28 Jan 2009 18:04:37 +0000 (19:04 +0100)]
x86, bigsmp: consolidate code

Move all code to arch/x86/kernel/bigsmp_32.c.

With this it ceases to rely on any build-time subarch features.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, NUMAQ: Consolidate code
Ingo Molnar [Wed, 28 Jan 2009 18:01:05 +0000 (19:01 +0100)]
x86, NUMAQ: Consolidate code

Move all NUMAQ code into arch/x86/kernel/numaq.c.

With this it ceases to rely on any build-time subarch features.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, ES7000: Consolidate code
Ingo Molnar [Wed, 28 Jan 2009 18:01:05 +0000 (19:01 +0100)]
x86, ES7000: Consolidate code

Move all ES7000 code into arch/x86/kernel/es7000_32.c.

With this it ceases to rely on any build-time subarch features.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: remove mach_apic.h, fix
Suresh Siddha [Thu, 29 Jan 2009 01:52:57 +0000 (17:52 -0800)]
x86: remove mach_apic.h, fix

Use apic_read() instead of open-coded mmio.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: remove mach_apic.h
Ingo Molnar [Wed, 28 Jan 2009 16:55:37 +0000 (17:55 +0100)]
x86: remove mach_apic.h

Spread mach_apic.h definitions into genapic.h. (with some knock-on effects
on smp.h and apic.h.)

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, summit: consolidate code, fix
Ingo Molnar [Thu, 29 Jan 2009 10:29:22 +0000 (11:29 +0100)]
x86, summit: consolidate code, fix

Build fix for !NUMA Summit.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, summit: consolidate code
Ingo Molnar [Wed, 28 Jan 2009 17:49:31 +0000 (18:49 +0100)]
x86, summit: consolidate code

Consolidate all the Summit code into a single file:
arch/x86/kernel/summit_32.c.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, numaq: consolidate code
Ingo Molnar [Wed, 28 Jan 2009 17:47:24 +0000 (18:47 +0100)]
x86, numaq: consolidate code

Move all the NUMAQ subarch definitions into numaq.c. With this it
ceases to depend on build-time subarch features.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, smp: refactor ->wake_cpu
Ingo Molnar [Wed, 28 Jan 2009 16:50:18 +0000 (17:50 +0100)]
x86, smp: refactor ->wake_cpu

- remove macro wrappers

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: remove mach_apicdef.h
Ingo Molnar [Wed, 28 Jan 2009 16:36:56 +0000 (17:36 +0100)]
x86: remove mach_apicdef.h

Move its definitions into apic.h.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: remove mach_mpspec.h
Ingo Molnar [Wed, 28 Jan 2009 16:36:56 +0000 (17:36 +0100)]
x86: remove mach_mpspec.h

Move its definitions into mpspec.h.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: eliminate asm/mach-*/mach_mpparse.h
Ingo Molnar [Wed, 28 Jan 2009 16:29:27 +0000 (17:29 +0100)]
x86: eliminate asm/mach-*/mach_mpparse.h

Move the definition to mpparse.h.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, smp: eliminate asm/mach-default/mach_wakecpu.h
Ingo Molnar [Wed, 28 Jan 2009 16:16:25 +0000 (17:16 +0100)]
x86, smp: eliminate asm/mach-default/mach_wakecpu.h

Spread mach_wakecpu.h's definitions into apic.h and genapic.h
and remove mach_wakecpu.h.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, ES7000: consolidate the APIC code
Ingo Molnar [Wed, 28 Jan 2009 16:09:58 +0000 (17:09 +0100)]
x86, ES7000: consolidate the APIC code

Consolidate all the ES7000 APIC code into arch/x86/mach-generic/es7000.c.

With this ES7000 ceases to rely on any subarchitecture include files.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, smp: refactor ->inquire_remote_apic() methods
Ingo Molnar [Wed, 28 Jan 2009 15:31:52 +0000 (16:31 +0100)]
x86, smp: refactor ->inquire_remote_apic() methods

Nothing exciting - a few subarches dont want APIC remote reads to
be performed - the others are content with the default method.

 - extend the generic code to handle NULL methods

 - clear out dummy methods and replace them with NULL

 - clean up: remove wrapper macros, etc.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, smp: remove ->restore_NMI_vector()
Ingo Molnar [Wed, 28 Jan 2009 15:43:47 +0000 (16:43 +0100)]
x86, smp: remove ->restore_NMI_vector()

Nothing actually restores the NMI vector - so remove this
logic altogether.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, smp: refactor ->store/restore_NMI_vector() methods
Ingo Molnar [Wed, 28 Jan 2009 15:31:52 +0000 (16:31 +0100)]
x86, smp: refactor ->store/restore_NMI_vector() methods

Only NUMAQ does something substantial here, because it initializes
via NMIs (not via INIT as standard SMP startup) - so it needs to
store and restore the NMI vector.

 - extend the generic code to handle NULL methods

 - clear out dummy methods and replace them with NULL

 - clean up: remove wrapper macros, etc.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, smp: refactor ->smp_callin_clear_local_apic() methods
Ingo Molnar [Wed, 28 Jan 2009 15:31:52 +0000 (16:31 +0100)]
x86, smp: refactor ->smp_callin_clear_local_apic() methods

Only NUMAQ does something substantial here, because it initializes
via NMIs (not via INIT as standard SMP startup) - so it needs to
reset the APIC.

 - extend the generic code to handle NULL methods

 - clear out dummy methods and replace them with NULL

 - clean up: remove wrapper macros, etc.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, smp: refactor ->wait_for_init_deassert()
Ingo Molnar [Wed, 28 Jan 2009 15:21:32 +0000 (16:21 +0100)]
x86, smp: refactor ->wait_for_init_deassert()

- spread out the namespace on a per APIC driver basis

 - handle a NULL ->wait_for_init_deassert() as a 'dont wait' default method

 - remove NUMAQ and Summit handlers

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: set ->trampoline_phys_low/high on 64-bit too
Ingo Molnar [Wed, 28 Jan 2009 15:15:16 +0000 (16:15 +0100)]
x86: set ->trampoline_phys_low/high on 64-bit too

64-bit x86 has zero for ->trampoline_phys_low/high, but the smpboot
code can use these values - so it's better to set them up to their
correct values.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, smp: clean up ->trampoline_phys_low/high handling
Ingo Molnar [Wed, 28 Jan 2009 15:09:23 +0000 (16:09 +0100)]
x86, smp: clean up ->trampoline_phys_low/high handling

- spread out the namespace on a per apic driver basis

 - remove wrapper macros

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, apic: untangle the send_IPI_*() jungle
Ingo Molnar [Wed, 28 Jan 2009 14:42:24 +0000 (15:42 +0100)]
x86, apic: untangle the send_IPI_*() jungle

Our send_IPI_*() methods and definitions are a twisted mess: the same
symbol is defined to different things depending on .config details,
in a non-transparent way.

 - spread out the quirks into separately named per apic driver methods

 - prefix the standard PC methods with default_

 - get rid of wrapper macro obfuscation

 - clean up various details

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, apic: refactor ->cpu_mask_to_apicid*()
Ingo Molnar [Wed, 28 Jan 2009 14:20:18 +0000 (15:20 +0100)]
x86, apic: refactor ->cpu_mask_to_apicid*()

- spread out the namespace on a per driver basis

 - clean up the functions

 - get rid of macros

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, apic: get rid of *_APIC_ID_MASK definitions
Ingo Molnar [Wed, 28 Jan 2009 14:08:53 +0000 (15:08 +0100)]
x86, apic: get rid of *_APIC_ID_MASK definitions

Impact: cleanup

Remove the *_APIC_ID_MASK subarch definitions and move them straight
to the genapic driver initialization code.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, apic: refactor ->apic_id_mask & APIC_ID_MASK
Ingo Molnar [Wed, 28 Jan 2009 13:59:17 +0000 (14:59 +0100)]
x86, apic: refactor ->apic_id_mask & APIC_ID_MASK

- spread out the namespace on a per driver basis

 - get rid of wrapper macros

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, apic: refactor ->get_apic_id() & GET_APIC_ID()
Ingo Molnar [Wed, 28 Jan 2009 13:08:38 +0000 (14:08 +0100)]
x86, apic: refactor ->get_apic_id() & GET_APIC_ID()

- spread out the namespace on a per driver basis

 - get rid of macro wrappers

 - small cleanups

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: consolidate the ->mps_oem_check() code
Ingo Molnar [Wed, 28 Jan 2009 12:44:32 +0000 (13:44 +0100)]
x86: consolidate the ->mps_oem_check() code

- spread out the mps_oem_check() namespace on a per APIC driver basis

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, mpparse: call the generic quirk handlers early
Ingo Molnar [Wed, 28 Jan 2009 12:54:56 +0000 (13:54 +0100)]
x86, mpparse: call the generic quirk handlers early

Call all the registered MPS quirk handlers early. These methods scan
low RAM typically for specific signatures so are safe to be called
early.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, smp: clean up mps_oem_check()
Ingo Molnar [Wed, 28 Jan 2009 12:47:42 +0000 (13:47 +0100)]
x86, smp: clean up mps_oem_check()

Impact: cleanup

 - allow NULL ->mps_oem_check() entries

 - clean up the code flow

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, apic: refactor ->phys_pkg_id()
Ingo Molnar [Wed, 28 Jan 2009 12:24:54 +0000 (13:24 +0100)]
x86, apic: refactor ->phys_pkg_id()

Refactor the ->phys_pkg_id() methods:

 - namespace separation

 - macro wrapper removal

 - open-coded calls to the methods in the generic code

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, apic: unify phys_pkg_id()
Ingo Molnar [Wed, 28 Jan 2009 12:31:22 +0000 (13:31 +0100)]
x86, apic: unify phys_pkg_id()

- unify the call signature of 64-bit to that of 32-bit

 - clean up the types all around

 - clean up namespace contamination

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, es7000: clean up es7000_enable_apic_mode()
Ingo Molnar [Wed, 28 Jan 2009 12:15:06 +0000 (13:15 +0100)]
x86, es7000: clean up es7000_enable_apic_mode()

- eliminate the needless es7000_enable_apic_mode() complication which
  was not apparent prior the namespace cleanups

- clean up the control flow in es7000_enable_apic_mode()

- other cleanups

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: refactor ->enable_apic_mode() subarch methods
Ingo Molnar [Wed, 28 Jan 2009 11:43:18 +0000 (12:43 +0100)]
x86: refactor ->enable_apic_mode() subarch methods

Only ES7000 has a real ->enable_apic_mode() method, the other
subarchitectures define it but keep it empty.

So mark the vector as NULL, extend the generic code to handle
NULL -setup_portio_remap() entries and remove all the empty
handlers.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: refactor ->check_phys_apicid_present() subarch methods
Ingo Molnar [Wed, 28 Jan 2009 11:43:18 +0000 (12:43 +0100)]
x86: refactor ->check_phys_apicid_present() subarch methods

- spread out the namespace to per driver methods

 - extend it to 64-bit as well so that we can use
   apic->check_phys_apicid_present() unconditionally

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: refactor ->setup_portio_remap() subarch methods
Ingo Molnar [Wed, 28 Jan 2009 11:43:18 +0000 (12:43 +0100)]
x86: refactor ->setup_portio_remap() subarch methods

Only NUMAQ has a real ->setup_portio_remap() method, the other
subarchitectures define it but keep it empty.

So mark the vector as NULL, extend the generic code to handle
NULL -setup_portio_remap() entries and remove all the empty
handlers.

Also move the NUMAQ method from the header file into the
 apic driver .c file.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, apic: clean up ->apicid_to_cpu_present()
Ingo Molnar [Wed, 28 Jan 2009 05:50:47 +0000 (06:50 +0100)]
x86, apic: clean up ->apicid_to_cpu_present()

- separate the namespace

 - remove macros

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, apic: clean up ->cpu_present_to_apicid()
Ingo Molnar [Wed, 28 Jan 2009 05:50:47 +0000 (06:50 +0100)]
x86, apic: clean up ->cpu_present_to_apicid()

- separate the namespace

 - remove macros

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, apic: clean up ->cpu_to_logical_apicid()
Ingo Molnar [Wed, 28 Jan 2009 05:50:47 +0000 (06:50 +0100)]
x86, apic: clean up ->cpu_to_logical_apicid()

- separate the namespace

 - remove macros

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, apic: clean up ->apicid_to_node()
Ingo Molnar [Wed, 28 Jan 2009 05:50:47 +0000 (06:50 +0100)]
x86, apic: clean up ->apicid_to_node()

- separate the namespace

 - remove macros

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, apic: streamline the ->multi_timer_check() quirk
Ingo Molnar [Wed, 28 Jan 2009 06:17:26 +0000 (07:17 +0100)]
x86, apic: streamline the ->multi_timer_check() quirk

only NUMAQ uses this quirk: to prevent the timer IRQ from being added
on secondary nodes.

All other genapic templates can have a NULL ->multi_timer_check()
callback.

Also, extend the generic code to treat a NULL pointer accordingly.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, apic: clean up ->setup_apic_routing()
Ingo Molnar [Wed, 28 Jan 2009 05:50:47 +0000 (06:50 +0100)]
x86, apic: clean up ->setup_apic_routing()

- separate the namespace

 - remove macros

 - remove namespace clash on 64-bit

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, apic: clean up ->ioapic_phys_id_map()
Ingo Molnar [Wed, 28 Jan 2009 05:50:47 +0000 (06:50 +0100)]
x86, apic: clean up ->ioapic_phys_id_map()

- separate the namespace

 - remove macros

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, apic: clean up ->init_apic_ldr()
Ingo Molnar [Wed, 28 Jan 2009 05:50:47 +0000 (06:50 +0100)]
x86, apic: clean up ->init_apic_ldr()

- separate the namespace

 - remove macros

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, apic: clean up ->vector_allocation_domain()
Ingo Molnar [Wed, 28 Jan 2009 05:50:47 +0000 (06:50 +0100)]
x86, apic: clean up ->vector_allocation_domain()

- separate the namespace

 - remove macros

 - move the default vector-allocation-domain to mach-generic

 - fix whitespace damage

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, apic: remove no_balance_irq and no_ioapic_check flags
Ingo Molnar [Wed, 28 Jan 2009 04:57:56 +0000 (05:57 +0100)]
x86, apic: remove no_balance_irq and no_ioapic_check flags

These flags are completely unused. (the in-kernel IRQ balancer has
been removed from the upstream kernel.)

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, apic: clean up check_apicid*() callbacks
Ingo Molnar [Wed, 28 Jan 2009 04:41:42 +0000 (05:41 +0100)]
x86, apic: clean up check_apicid*() callbacks

Clean up these methods - to make it clearer which function is
used in which case.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, apic: rename genapic::apic_destination_logical to genapic::dest_logical
Ingo Molnar [Wed, 28 Jan 2009 04:29:25 +0000 (05:29 +0100)]
x86, apic: rename genapic::apic_destination_logical to genapic::dest_logical

This field name was unreasonably long - shorten it.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: clean up the APIC_DEST_LOGICAL logic
Ingo Molnar [Wed, 28 Jan 2009 04:13:04 +0000 (05:13 +0100)]
x86: clean up the APIC_DEST_LOGICAL logic

Impact: cleanup

The bigsmp and es7000 subarchitectures un-defined APIC_DEST_LOGICAL in
a rather nasty way by re-defining it to zero. That is infinitely
fragile and makes it very hard to see what to code really does in
a given context. The very same constant has different meanings and
values - depending on which subarch is enabled.

Untangle this mess by never undefining the constant, but instead
propagating the right values into the genapic driver templates.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: rename ->ESR_DISABLE to ->disable_esr
Ingo Molnar [Wed, 28 Jan 2009 04:08:44 +0000 (05:08 +0100)]
x86: rename ->ESR_DISABLE to ->disable_esr

the ->ESR_DISABLE shouting variant was used to enable the esr_disable
macro wrappers. Those ugly macros are removed now so we can rename
->ESR_DISABLE to ->disable_esr

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: clean up esr_disable() methods
Ingo Molnar [Wed, 28 Jan 2009 04:01:41 +0000 (05:01 +0100)]
x86: clean up esr_disable() methods

Impact: cleanup

Most subarchitectures want to disable the APIC ESR (Error Status Register),
because they generally have hardware hacks that wrap standard CPUs into
a bigger system and hence the APIC bus is quite non-standard and weirdnesses
(lockups) have been seen with ESR reporting.

Remove the esr_disable macros and put the desired flag into each
subarchitecture's genapic template directly.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, apic: clean up / remove TARGET_CPUS
Ingo Molnar [Wed, 28 Jan 2009 03:32:51 +0000 (04:32 +0100)]
x86, apic: clean up / remove TARGET_CPUS

Impact: cleanup

use apic->target_cpus() directly instead of the TARGET_CPUS wrapper.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, apic: clean up target_cpus methods
Ingo Molnar [Wed, 28 Jan 2009 03:30:40 +0000 (04:30 +0100)]
x86, apic: clean up target_cpus methods

Impact: cleanup

Clean up all the target_cpus() namespace overlap that exists
between bigsmp, es7000, mach-default, numaq and summit - by
separating the different functions into different names.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, apic: remove IRQ_DEST_MODE
Ingo Molnar [Wed, 28 Jan 2009 03:24:16 +0000 (04:24 +0100)]
x86, apic: remove IRQ_DEST_MODE

Remove leftover definition.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, apic: remove ES7000_IRQ_DELIVERY_MODE and ES7000_IRQ_DEST_MODE
Ingo Molnar [Wed, 28 Jan 2009 03:16:01 +0000 (04:16 +0100)]
x86, apic: remove ES7000_IRQ_DELIVERY_MODE and ES7000_IRQ_DEST_MODE

Impact: cleanup

They were only used in a single place and obscured the apic_es7000
driver template.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, apic: remove BIGSMP_IRQ_DELIVERY_MODE and BIGSMP_IRQ_DEST_MODE
Ingo Molnar [Wed, 28 Jan 2009 03:16:01 +0000 (04:16 +0100)]
x86, apic: remove BIGSMP_IRQ_DELIVERY_MODE and BIGSMP_IRQ_DEST_MODE

Impact: cleanup

They were only used in a single place and obscured the apic_bigsmp
driver template.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, apic: remove NUMAQ_IRQ_DELIVERY_MODE and NUMAQ_IRQ_DEST_MODE
Ingo Molnar [Wed, 28 Jan 2009 03:16:01 +0000 (04:16 +0100)]
x86, apic: remove NUMAQ_IRQ_DELIVERY_MODE and NUMAQ_IRQ_DEST_MODE

Impact: cleanup

They were only used in a single place and obscured the apic_numaq template.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, apic: remove SUMMIT_IRQ_DELIVERY_MODE and SUMMIT_IRQ_DEST_MODE
Ingo Molnar [Wed, 28 Jan 2009 03:16:01 +0000 (04:16 +0100)]
x86, apic: remove SUMMIT_IRQ_DELIVERY_MODE and SUMMIT_IRQ_DEST_MODE

Impact: cleanup

They were only used in a single place and obscured the apic_summit template.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, apic: remove DEFAULT_IRQ_DELIVERY_MODE and DEFAULT_IRQ_DEST_MODE
Ingo Molnar [Wed, 28 Jan 2009 03:16:01 +0000 (04:16 +0100)]
x86, apic: remove DEFAULT_IRQ_DELIVERY_MODE and DEFAULT_IRQ_DEST_MODE

Impact: cleanup

They were only used in a single place and obscured the apic_default template.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, apic: remove IRQ_DEST_MODE / IRQ_DELIVERY_MODE
Ingo Molnar [Wed, 28 Jan 2009 03:09:58 +0000 (04:09 +0100)]
x86, apic: remove IRQ_DEST_MODE / IRQ_DELIVERY_MODE

Remove the wrapper macros IRQ_DEST_MODE and IRQ_DELIVERY_MODE.

The typical 32-bit and the 64-bit build all dereference via the genapic,
so it's pointless to hide that indirection via these ugly macros.

Furthermore, it also obscures subarchitecture details.

So replace it with apic->irq_dest_mode / etc. accesses.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, genapic: rename int_delivery_mode, et. al.
Ingo Molnar [Wed, 28 Jan 2009 03:02:31 +0000 (04:02 +0100)]
x86, genapic: rename int_delivery_mode, et. al.

int_delivery_mode is supposed to mean 'interrupt delivery mode', but
it's quite a misnomer as 'int' we usually think of as an integer type ...

The standard naming for such attributes is 'irq' - so rename the following
fields and macros:

 int_delivery_mode => irq_delivery_mode
 INT_DELIVERY_MODE => IRQ_DELIVERY_MODE
 int_dest_mode     => irq_dest_mode
 INT_DEST_MODE     => IRQ_DEST_MODE

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: clean up apic->apic_id_registered() methods
Ingo Molnar [Wed, 28 Jan 2009 02:43:47 +0000 (03:43 +0100)]
x86: clean up apic->apic_id_registered() methods

Impact: cleanup

x86 subarchitectures each defined a "apic_id_registered()" method,
which could be an inline function depending on which subarch we build
for, and which was also the name of a genapic field.

Untangle this namespace spaghetti by giving each of the instances
a separate name.

Also remove wrapper macro obfuscation.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: clean up apic->acpi_madt_oem_check methods
Ingo Molnar [Wed, 28 Jan 2009 02:43:47 +0000 (03:43 +0100)]
x86: clean up apic->acpi_madt_oem_check methods

Impact: refactor code

x86 subarchitectures each defined a "acpi_madt_oem_check()" method,
which could be an inline function, or an extern, or a static function,
and which was also the name of a genapic field.

Untangle this namespace spaghetti by setting ->acpi_madt_oem_check()
to NULL on those subarchitectures that have no detection quirks,
and rename the other ones (summit, es7000) that do.

Also change default_acpi_madt_oem_check() to handle NULL entries,
and clean its control flow up as well.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: remove APIC_INIT / APICFUNC / IPIFUNC
Ingo Molnar [Wed, 28 Jan 2009 02:18:13 +0000 (03:18 +0100)]
x86: remove APIC_INIT / APICFUNC / IPIFUNC

The APIC_INIT() / APICFUNC / IPIFUNC macros were ugly and obfuscated
the true identity of various APIC driver methods.

Now that they are not used anymore, remove them.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, genapic: cleanup 32-bit apic_summit template
Ingo Molnar [Wed, 28 Jan 2009 02:32:03 +0000 (03:32 +0100)]
x86, genapic: cleanup 32-bit apic_summit template

Clean up the APIC driver template:

 - order fields properly
 - use the macro names explicitly (so that they can be renamed later)
 - fill in NULL entries as well

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, genapic: cleanup 32-bit apic_es7000 template
Ingo Molnar [Wed, 28 Jan 2009 02:32:03 +0000 (03:32 +0100)]
x86, genapic: cleanup 32-bit apic_es7000 template

Clean up the APIC driver template:

 - order fields properly
 - use the macro names explicitly (so that they can be renamed later)
 - fill in NULL entries as well

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, genapic: cleanup 32-bit apic_numaq template
Ingo Molnar [Wed, 28 Jan 2009 02:32:03 +0000 (03:32 +0100)]
x86, genapic: cleanup 32-bit apic_numaq template

Clean up the APIC driver template:

 - order fields properly
 - use the macro names explicitly (so that they can be renamed later)
 - fill in NULL entries as well

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, genapic: cleanup 32-bit apic_bigsmp template
Ingo Molnar [Wed, 28 Jan 2009 02:32:03 +0000 (03:32 +0100)]
x86, genapic: cleanup 32-bit apic_bigsmp template

Clean up the APIC driver template:

 - order fields properly
 - use the macro names explicitly (so that they can be renamed later)
 - fill in NULL entries as well

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, genapic: cleanup 32-bit apic_default template
Ingo Molnar [Wed, 28 Jan 2009 02:32:03 +0000 (03:32 +0100)]
x86, genapic: cleanup 32-bit apic_default template

Clean up the APIC driver template:

 - order fields properly
 - use the macro names explicitly (so that they can be renamed later)
 - fill in NULL entries as well

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: clean up apic_x2apic_cluster
Ingo Molnar [Wed, 28 Jan 2009 01:37:01 +0000 (02:37 +0100)]
x86: clean up apic_x2apic_cluster

- reorder fields so that they appear in struct genapic field ordering

- add zero-initialized fields too so that it's apparent which functionality
  is default / missing.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: clean up apic_x2apic_phys
Ingo Molnar [Wed, 28 Jan 2009 01:37:01 +0000 (02:37 +0100)]
x86: clean up apic_x2apic_phys

- reorder fields so that they appear in struct genapic field ordering

- add zero-initialized fields too so that it's apparent which functionality
  is default / missing.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: clean up apic_x2apic_uv_x
Ingo Molnar [Wed, 28 Jan 2009 01:37:01 +0000 (02:37 +0100)]
x86: clean up apic_x2apic_uv_x

- reorder fields so that they appear in struct genapic field ordering

- add zero-initialized fields too so that it's apparent which functionality
  is default / missing.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: clean up genapic_phys_flat
Ingo Molnar [Wed, 28 Jan 2009 01:37:01 +0000 (02:37 +0100)]
x86: clean up genapic_phys_flat

- reorder fields so that they appear in struct genapic field ordering

- add zero-initialized fields too so that it's apparent which functionality
  is default / missing.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: clean up genapic_flat
Ingo Molnar [Wed, 28 Jan 2009 01:37:01 +0000 (02:37 +0100)]
x86: clean up genapic_flat

- reorder fields so that they appear in struct genapic field ordering

- add zero-initialized fields too so that it's apparent which functionality
  is default / missing.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86: rename 'genapic' to 'apic'
Ingo Molnar [Tue, 27 Jan 2009 23:14:11 +0000 (00:14 +0100)]
x86: rename 'genapic' to 'apic'

Rename genapic-> to apic-> references because in a future chagne we'll
open-code all the indirect calls (instead of obscuring them via macros),
so we want this reference to be as short as possible.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, genapic: provide IPI callbacks unconditionally
Ingo Molnar [Tue, 27 Jan 2009 22:54:23 +0000 (23:54 +0100)]
x86, genapic: provide IPI callbacks unconditionally

64-bit x86 uses the IPI callbacks even on UP - so provide them
generally.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
15 years agox86, genapic: cleanups
Ingo Molnar [Tue, 27 Jan 2009 22:23:22 +0000 (23:23 +0100)]
x86, genapic: cleanups

Unify genapic.h some more.

Signed-off-by: Ingo Molnar <mingo@elte.hu>