29 Sep, 2011

1 commit

  • These warnings (generally one per CPU) are a result of
    initializing x86_cpu_to_logical_apicid while apic_default is
    still in use, but the check in setup_local_APIC() being done
    when apic_bigsmp was already used as an override in
    default_setup_apic_routing():

    Overriding APIC driver with bigsmp
    Enabling APIC mode: Physflat. Using 5 I/O APICs
    ------------[ cut here ]------------
    WARNING: at .../arch/x86/kernel/apic/apic.c:1239
    ...
    CPU 1 irqstacks, hard=f1c9a000 soft=f1c9c000
    Booting Node 0, Processors #1
    smpboot cpu 1: start_ip = 9e000
    Initializing CPU#1
    ------------[ cut here ]------------
    WARNING: at .../arch/x86/kernel/apic/apic.c:1239
    setup_local_APIC+0x137/0x46b() Hardware name: ...
    CPU1 logical APIC ID: 2 != 8
    ...

    Fix this (for the time being, i.e. until
    x86_32_early_logical_apicid() will get removed again, as Tejun
    says ought to be possible) by overriding the previously stored
    values at the point where the APIC driver gets overridden.

    v2: Move this and the pre-existing override logic into
    arch/x86/kernel/apic/bigsmp_32.c.

    Signed-off-by: Jan Beulich
    Acked-by: Tejun Heo
    Cc: (2.6.39 and onwards)
    Link: http://lkml.kernel.org/r/4E835D16020000780005844C@nat28.tlf.novell.com
    Signed-off-by: Ingo Molnar

    Jan Beulich
     

22 May, 2011

4 commits

  • Apic probe now looks at the apic drivers listed in the
    .apicdrivers section. Remove apic_probe[] and make each apic
    driver static.

    Signed-off-by: Suresh Siddha
    Tested-by: Cyrill Gorcunov
    Cc: steiner@sgi.com
    Cc: gorcunov@openvz.org
    Cc: yinghai@kernel.org
    Link: http://lkml.kernel.org/r/20110521005526.341718626@sbsiddha-MOBL3.sc.intel.com
    Signed-off-by: Ingo Molnar

    Suresh Siddha
     
  • Make generic_bigsmp_probe() return struct apic *. This will
    avoid exporting apic_bigsmp, which will be consistent with
    others.

    Signed-off-by: Suresh Siddha
    Tested-by: Cyrill Gorcunov
    Cc: steiner@sgi.com
    Cc: gorcunov@openvz.org
    Cc: yinghai@kernel.org
    Link: http://lkml.kernel.org/r/20110521005526.252703851@sbsiddha-MOBL3.sc.intel.com
    Signed-off-by: Ingo Molnar

    Suresh Siddha
     
  • This will eliminate the need for apic_probe[], as the probing
    now will happen based on the apic drivers order in the
    .apcidrivers section.

    Signed-off-by: Suresh Siddha
    Tested-by: Cyrill Gorcunov
    Cc: steiner@sgi.com
    Cc: gorcunov@openvz.org
    Cc: yinghai@kernel.org
    Link: http://lkml.kernel.org/r/20110521005526.164277071@sbsiddha-MOBL3.sc.intel.com
    Signed-off-by: Ingo Molnar

    Suresh Siddha
     
  • This will pave the way for each apic driver to be self-contained
    and eliminate the need for apic_probe[].

    Order in which apic drivers are listed in the .apicdrivers
    section is important, as this determines the apic probe order.
    And this is enforced by the ordering of apic driver files in the
    Makefile and the macros apic_driver()/apic_drivers().

    Signed-off-by: Suresh Siddha
    Tested-by: Cyrill Gorcunov
    Cc: steiner@sgi.com
    Cc: gorcunov@openvz.org
    Cc: yinghai@kernel.org
    Link: http://lkml.kernel.org/r/20110521005526.068775085@sbsiddha-MOBL3.sc.intel.com
    Signed-off-by: Ingo Molnar

    Suresh Siddha
     

02 May, 2011

1 commit

  • NUMAQ is the only meaningful user of this callback and
    setup_local_APIC() the only callsite. Stop torturing everyone else by
    making the callback optional and removing all the boilerplate
    implementations and assignments.

    Signed-off-by: Tejun Heo
    Cc: Ingo Molnar
    Cc: Yinghai Lu
    Cc: David Rientjes
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"

    Tejun Heo
     

28 Jan, 2011

4 commits

  • apic->apicid_to_node() is 32bit specific apic operation which
    determines NUMA node for a CPU. Depending on the APIC
    implementation, it can be easier to determine NUMA node from
    either physical or logical apicid. Currently,
    ->apicid_to_node() takes @logical_apicid and calls
    hard_smp_processor_id() if the physical apicid is needed.

    This prevents NUMA mapping from being queried from a different
    CPU, which in turn makes it impossible to initialize NUMA
    mapping before SMP bringup.

    This patch replaces apic->apicid_to_node() with
    ->x86_32_numa_cpu_node() which takes @cpu, from which both
    logical and physical apicids can easily be determined. While at
    it, drop duplicate implementations from bigsmp_32 and summit_32,
    and use the default one.

    Signed-off-by: Tejun Heo
    Reviewed-by: Pekka Enberg
    Cc: eric.dumazet@gmail.com
    Cc: yinghai@kernel.org
    Cc: brgerst@gmail.com
    Cc: gorcunov@gmail.com
    Cc: shaohui.zheng@intel.com
    Cc: rientjes@google.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Tejun Heo
     
  • Implement x86_32_early_logical_apicid() for the default apic
    flat routing.

    Signed-off-by: Tejun Heo
    Cc: eric.dumazet@gmail.com
    Cc: yinghai@kernel.org
    Cc: brgerst@gmail.com
    Cc: gorcunov@gmail.com
    Cc: penberg@kernel.org
    Cc: shaohui.zheng@intel.com
    Cc: rientjes@google.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Tejun Heo
     
  • On x86_32, the mapping between cpu and logical apic ID differs
    depending on the specific apic implementation in use. The
    mapping is initialized while bringing up CPUs; however, this
    makes early inits ignore memory topology.

    Add a x86_32 specific apic->x86_32_early_logical_apicid() which
    is called early during boot to query the mapping. The mapping
    is later verified against the result of init_apic_ldr(). The
    method is allowed to return BAD_APICID if it can't be determined
    early.

    noop variant which always returns BAD_APICID is implemented and
    added to all x86_32 apic implementations.

    Signed-off-by: Tejun Heo
    Cc: eric.dumazet@gmail.com
    Cc: yinghai@kernel.org
    Cc: brgerst@gmail.com
    Cc: gorcunov@gmail.com
    Cc: penberg@kernel.org
    Cc: shaohui.zheng@intel.com
    Cc: rientjes@google.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Tejun Heo
     
  • After the previous patch, apic->cpu_to_logical_apicid() is no
    longer used. Kill it.

    For apic types with custom cpu_to_logical_apicid() which is also
    used for other purposes, remove the function and modify its
    users to do the mapping directly.

    #ifdef's on CONFIG_SMP in es7000_32 and summit_32 are ignored
    during conversion as they are not used for UP kernels.

    Signed-off-by: Tejun Heo
    Cc: eric.dumazet@gmail.com
    Cc: yinghai@kernel.org
    Cc: brgerst@gmail.com
    Cc: gorcunov@gmail.com
    Cc: penberg@kernel.org
    Cc: shaohui.zheng@intel.com
    Cc: rientjes@google.com
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Tejun Heo
     

10 Feb, 2010

1 commit

  • We need to fall back from logical-flat APIC mode to physical-flat mode
    when we have more than 8 CPUs. However, in the presence of CPU
    hotplug(with bios listing not enabled but possible cpus as disabled cpus in
    MADT), we have to consider the number of possible CPUs rather than
    the number of current CPUs; otherwise we may cross the 8-CPU boundary
    when CPUs are added later.

    32bit apic code can use more cleanups (like the removal of vendor checks in
    32bit default_setup_apic_routing()) and more unifications with 64bit code.
    Yinghai has some patches in works already. This patch addresses the boot issue
    that is reported in the virtualization guest context.

    [ hpa: incorporated function annotation feedback from Yinghai Lu ]

    Signed-off-by: Suresh Siddha
    LKML-Reference:
    Acked-by: Shaohui Zheng
    Reviewed-by: Yinghai Lu
    Cc:
    Signed-off-by: H. Peter Anvin

    Suresh Siddha
     

10 Nov, 2009

1 commit

  • We should not use physid_mask_t as a stack based
    variable in apic code. This type depends on MAX_APICS
    parameter which may be huge enough.

    Especially it became a problem with apic NOOP driver which
    is portable between 32 bit and 64 bit environment
    (where we have really huge MAX_APICS).

    So apic driver should operate with pointers and a caller
    in turn should aware of allocation physid_mask_t variable.

    As a side (but positive) effect -- we may use already
    implemented physid_set_mask_of_physid function eliminating
    default_apicid_to_cpu_present completely.

    Note that physids_coerce and physids_promote turned into static
    inline from macro (since macro hides the fact that parameter is
    being interpreted as unsigned long, make it explicit).

    Signed-off-by: Cyrill Gorcunov
    Cc: Yinghai Lu
    Cc: Maciej W. Rozycki
    Cc: Stephen Rothwell
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Cyrill Gorcunov
     

18 Jun, 2009

1 commit


12 Apr, 2009

1 commit

  • Impact: cleanup, no code changed

    - syscalls.h update declarations due to unifications
    - irq.c declare smp_generic_interrupt() before it gets used
    - process.c declare sys_fork() and sys_vfork() before they get used
    - tsc.c rename tsc_khz shadowed variable
    - apic/probe_32.c declare apic_default before it gets used
    - apic/nmi.c prev_nmi_count should be unsigned
    - apic/io_apic.c declare smp_irq_move_cleanup_interrupt() before it gets used
    - mm/init.c declare direct_gbpages and free_initrd_mem before they get used

    Signed-off-by: Jaswinder Singh Rajput
    Signed-off-by: Ingo Molnar

    Jaswinder Singh Rajput
     

13 Mar, 2009

1 commit


26 Feb, 2009

2 commits

  • Impact: cleanup

    - rename apic->wakeup_cpu to apic->wakeup_secondary_cpu, to
    make it apparent that this is an SMP-only method

    - handle NULL ->wakeup_secondary_cpus to mean the default INIT
    wakeup sequence - this allows simplification of the APIC
    driver templates.

    Cc: Yinghai Lu
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Impact: cleanup

    x86_quirks->update_apic() calling looks crazy. so try to remove it:

    1. every apic take wakeup_cpu member directly
    2. separate es7000_apic to es7000_apic_cluster
    3. use uv_wakeup_cpu directly

    Signed-off-by: Yinghai Lu
    Signed-off-by: Ingo Molnar

    Yinghai Lu
     

23 Feb, 2009

1 commit

  • Impact: cleanup

    Make x86_quirks support more transparent. The highlevel
    methods are now named:

    extern void x86_quirk_pre_intr_init(void);
    extern void x86_quirk_intr_init(void);

    extern void x86_quirk_trap_init(void);

    extern void x86_quirk_pre_time_init(void);
    extern void x86_quirk_time_init(void);

    This makes it clear that if some platform extension has to
    do something here that it is considered ... weird, and is
    discouraged.

    Also remove arch_hooks.h and move it into setup.h (and other
    header files where appropriate).

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

18 Feb, 2009

2 commits