1. 08 7月, 2008 9 次提交
    • G
      x86: use stack_start in x86_64 · 9cf4f298
      Glauber Costa 提交于
      call x86_64's init_rsp stack_start, just as i386 does.
      Put a zeroed stack segment for consistency. With this,
      we can eliminate one ugly ifdef in smpboot.c.
      Signed-off-by: NGlauber Costa <gcosta@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      9cf4f298
    • J
      x86: fix stack overflow for large values of MAX_APICS · b6df1b8b
      Jack Steiner 提交于
      physid_mask_of_physid() causes a huge stack (12k) to be created if the
      number of APICS is large. Replace physid_mask_of_physid() with a
      new function that does not create large stacks. This is a problem only
      on large x86_64 systems.
      
      this paves the way to increase MAX_APICS.
      Signed-off-by: NJack Steiner <steiner@sgi.com>
      Cc: linux-mm@kvack.org
      Cc: mingo@elte.hu
      Cc: tglx@linutronix.de
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      b6df1b8b
    • J
      x86: compile error fix for smpboot.c · f307d25e
      Jeremy Fitzhardinge 提交于
      Without this patch, my link fails with:
      
      arch/x86/kernel/built-in.o(.cpuinit.text+0x3c6e): In function `get_local_pda':
      : undefined reference to `_cpu_pda'
      arch/x86/kernel/built-in.o(.cpuinit.text+0x3cd1): In function `get_local_pda':
      : undefined reference to `after_bootmem'
      arch/x86/kernel/built-in.o(.cpuinit.text+0x3cec): In function `get_local_pda':
      : undefined reference to `_cpu_pda'
      make[2]: *** [.tmp_vmlinux1] Error 1
      
      Caused by commit 766da892634694f795b18b9538407816896fc470
          x86: remove static boot_cpu_pda array v2
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      f307d25e
    • M
      x86: remove static boot_cpu_pda array v2 · 3461b0af
      Mike Travis 提交于
        * Remove the boot_cpu_pda array and pointer table from the data section.
          Allocate the pointer table and array during init.  do_boot_cpu()
          will reallocate the pda in node local memory and if the cpu is being
          brought up before the bootmem array is released (after_bootmem = 0),
          then it will free the initial pda.  This will happen for all cpus
          present at system startup.
      
          This removes 512k + 32k bytes from the data section.
      
      For inclusion into sched-devel/latest tree.
      
      Based on:
      	git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
          +   sched-devel/latest  .../mingo/linux-2.6-sched-devel.git
      Signed-off-by: NMike Travis <travis@sgi.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      3461b0af
    • M
      x86: cleanup early per cpu variables/accesses v4 · 23ca4bba
      Mike Travis 提交于
        * Introduce a new PER_CPU macro called "EARLY_PER_CPU".  This is
          used by some per_cpu variables that are initialized and accessed
          before there are per_cpu areas allocated.
      
          ["Early" in respect to per_cpu variables is "earlier than the per_cpu
          areas have been setup".]
      
          This patchset adds these new macros:
      
      	DEFINE_EARLY_PER_CPU(_type, _name, _initvalue)
      	EXPORT_EARLY_PER_CPU_SYMBOL(_name)
      	DECLARE_EARLY_PER_CPU(_type, _name)
      
      	early_per_cpu_ptr(_name)
      	early_per_cpu_map(_name, _idx)
      	early_per_cpu(_name, _cpu)
      
          The DEFINE macro defines the per_cpu variable as well as the early
          map and pointer.  It also initializes the per_cpu variable and map
          elements to "_initvalue".  The early_* macros provide access to
          the initial map (usually setup during system init) and the early
          pointer.  This pointer is initialized to point to the early map
          but is then NULL'ed when the actual per_cpu areas are setup.  After
          that the per_cpu variable is the correct access to the variable.
      
          The early_per_cpu() macro is not very efficient but does show how to
          access the variable if you have a function that can be called both
          "early" and "late".  It tests the early ptr to be NULL, and if not
          then it's still valid.  Otherwise, the per_cpu variable is used
          instead:
      
      	#define early_per_cpu(_name, _cpu) 			\
      		(early_per_cpu_ptr(_name) ?			\
      			early_per_cpu_ptr(_name)[_cpu] :	\
      			per_cpu(_name, _cpu))
      
          A better method is to actually check the pointer manually.  In the
          case below, numa_set_node can be called both "early" and "late":
      
      	void __cpuinit numa_set_node(int cpu, int node)
      	{
      	    int *cpu_to_node_map = early_per_cpu_ptr(x86_cpu_to_node_map);
      
      	    if (cpu_to_node_map)
      		    cpu_to_node_map[cpu] = node;
      	    else
      		    per_cpu(x86_cpu_to_node_map, cpu) = node;
      	}
      
        * Add a flag "arch_provides_topology_pointers" that indicates pointers
          to topology cpumask_t maps are available.  Otherwise, use the function
          returning the cpumask_t value.  This is useful if cpumask_t set size
          is very large to avoid copying data on to/off of the stack.
      
        * The coverage of CONFIG_DEBUG_PER_CPU_MAPS has been increased while
          the non-debug case has been optimized a bit.
      
        * Remove an unreferenced compiler warning in drivers/base/topology.c
      
        * Clean up #ifdef in setup.c
      
      For inclusion into sched-devel/latest tree.
      
      Based on:
      	git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
          +   sched-devel/latest  .../mingo/linux-2.6-sched-devel.git
      Signed-off-by: NMike Travis <travis@sgi.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      23ca4bba
    • M
      x86: APIC/SMP: Downgrade the NMI watchdog for "nosmp" · d54db1ac
      Maciej W. Rozycki 提交于
       If configured to use the I/O APIC, the NMI watchdog is deemed to fail if
      the chip has been deactivated as a result of "nosmp".  Downgrade to the
      local APIC watchdog similarly to what is done for the UP case.
      Signed-off-by: NMaciej W. Rozycki <macro@linux-mips.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      d54db1ac
    • I
      Revert "x86: APIC/SMP: downgrade the NMI watchdog for "nosmp"" · 6fe9fe87
      Ingo Molnar 提交于
      This reverts commit 791b93d3dfaf16c23e978bec0cc0a3dd9d855d63.
      
      A better fix from Maciej will be merged.
      6fe9fe87
    • M
      x86: APIC/SMP: downgrade the NMI watchdog for "nosmp" · a1133d8e
      Maciej W. Rozycki 提交于
      If configured to use the I/O APIC, the NMI watchdog is deemed to fail if
      the chip has been deactivated as a result of "nosmp".  Downgrade to the
      local APIC watchdog similarly to what is done for the UP case.
      Signed-off-by: NMaciej W. Rozycki <macro@linux-mips.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a1133d8e
    • M
      x86: APIC/SMP: correct the message for "nosmp" · 73d08e63
      Maciej W. Rozycki 提交于
      The local APIC is no longer forced off when "nosmp" has been specified.
      Correct the message printed.
      Signed-off-by: NMaciej W. Rozycki <macro@linux-mips.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      73d08e63
  2. 30 6月, 2008 1 次提交
    • Z
      x86: fix cpu hotplug crash · fcb43042
      Zhang, Yanmin 提交于
      Vegard Nossum reported crashes during cpu hotplug tests:
      
        http://marc.info/?l=linux-kernel&m=121413950227884&w=4
      
      In function _cpu_up, the panic happens when calling
      __raw_notifier_call_chain at the second time. Kernel doesn't panic when
      calling it at the first time. If just say because of nr_cpu_ids, that's
      not right.
      
      By checking the source code, I found that function do_boot_cpu is the culprit.
      Consider below call chain:
       _cpu_up=>__cpu_up=>smp_ops.cpu_up=>native_cpu_up=>do_boot_cpu.
      
      So do_boot_cpu is called in the end. In do_boot_cpu, if
      boot_error==true, cpu_clear(cpu, cpu_possible_map) is executed. So later
      on, when _cpu_up calls __raw_notifier_call_chain at the second time to
      report CPU_UP_CANCELED, because this cpu is already cleared from
      cpu_possible_map, get_cpu_sysdev returns NULL.
      
      Many resources are related to cpu_possible_map, so it's better not to
      change it.
      
      Below patch against 2.6.26-rc7 fixes it by removing the bit clearing in
      cpu_possible_map.
      Signed-off-by: NZhang Yanmin <yanmin_zhang@linux.intel.com>
      Tested-by: NVegard Nossum <vegard.nossum@gmail.com>
      Acked-by: NRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      fcb43042
  3. 04 6月, 2008 1 次提交
    • I
      x86: disable preemption in native_smp_prepare_cpus · deef3250
      Ingo Molnar 提交于
      Priit Laes reported the following warning:
      
      Call Trace:
       [<ffffffff8022f1e1>] warn_on_slowpath+0x51/0x63
       [<ffffffff80282e48>] sys_ioctl+0x2d/0x5d
       [<ffffffff805185ff>] _spin_lock+0xe/0x24
       [<ffffffff80227459>] task_rq_lock+0x3d/0x73
       [<ffffffff805133c3>] set_cpu_sibling_map+0x336/0x350
       [<ffffffff8021c1b8>] read_apic_id+0x30/0x62
       [<ffffffff806d921d>] verify_local_APIC+0x90/0x138
       [<ffffffff806d84b5>] native_smp_prepare_cpus+0x1f9/0x305
       [<ffffffff806ce7b1>] kernel_init+0x59/0x2d9
       [<ffffffff80518a26>] _spin_unlock_irq+0x11/0x2b
       [<ffffffff8020bf48>] child_rip+0xa/0x12
       [<ffffffff806ce758>] kernel_init+0x0/0x2d9
       [<ffffffff8020bf3e>] child_rip+0x0/0x12
      
      fix this by generally disabling preemption in native_smp_prepare_cpus().
      Reported-and-bisected-by: NPriit Laes <plaes@plaes.org>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      deef3250
  4. 25 5月, 2008 2 次提交
    • Y
      x86: extend e820 ealy_res support 32bit · a4c81cf6
      Yinghai Lu 提交于
      move early_res related from e820_64.c to e820.c
      make edba detection to be done in head32.c
      remove smp_alloc_memory, because we have fixed trampoline address now.
      Signed-off-by: NYinghai Lu <yhlu.kernel@gmail.com>
      
       arch/x86/kernel/e820.c              |  214 ++++++++++++++++++++++++++++++++++++
       arch/x86/kernel/e820_64.c           |  196 --------------------------------
       arch/x86/kernel/head32.c            |   76 ++++++++++++
       arch/x86/kernel/setup_32.c          |  109 +++---------------
       arch/x86/kernel/smpboot.c           |   17 --
       arch/x86/kernel/trampoline.c        |    2
       arch/x86/mach-voyager/voyager_smp.c |    9 -
       include/asm-x86/e820.h              |    6 +
       include/asm-x86/e820_64.h           |    9 -
       include/asm-x86/smp.h               |    1
       arch/x86/kernel/e820.c              |  214 ++++++++++++++++++++++++++++++++++++
       arch/x86/kernel/e820_64.c           |  196 --------------------------------
       arch/x86/kernel/head32.c            |   76 ++++++++++++
       arch/x86/kernel/setup_32.c          |  109 +++---------------
       arch/x86/kernel/smpboot.c           |   17 --
       arch/x86/kernel/trampoline.c        |    2
       arch/x86/mach-voyager/voyager_smp.c |    9 -
       include/asm-x86/e820.h              |    6 +
       include/asm-x86/e820_64.h           |    9 -
       include/asm-x86/smp.h               |    1
       arch/x86/kernel/e820.c              |  214 ++++++++++++++++++++++++++++++++++++
       arch/x86/kernel/e820_64.c           |  196 --------------------------------
       arch/x86/kernel/head32.c            |   76 ++++++++++++
       arch/x86/kernel/setup_32.c          |  109 +++---------------
       arch/x86/kernel/smpboot.c           |   17 --
       arch/x86/kernel/trampoline.c        |    2
       arch/x86/mach-voyager/voyager_smp.c |    9 -
       include/asm-x86/e820.h              |    6 +
       include/asm-x86/e820_64.h           |    9 -
       include/asm-x86/smp.h               |    1
       10 files changed, 320 insertions(+), 319 deletions(-)
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      a4c81cf6
    • H
      x86: smpboot.c: removed duplicated include · 883b7af9
      Huang Weiyi 提交于
      Removed duplicated include <asm/nmi.h> in
      arch/x86/kernel/smpboot.c.
      Signed-off-by: NHuang Weiyi <weiyi.huang@gmail.com>
      Cc: mingo@redhat.com
      Cc: hpa@zytor.com
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      883b7af9
  5. 14 5月, 2008 1 次提交
    • H
      x86: fix app crashes after SMP resume · 61165d7a
      Hugh Dickins 提交于
      After resume on a 2cpu laptop, kernel builds collapse with a sed hang,
      sh or make segfault (often on 20295564), real-time signal to cc1 etc.
      
      Several hurdles to jump, but a manually-assisted bisect led to -rc1's
      d2bcbad5 x86: do not zap_low_mappings
      in __smp_prepare_cpus.  Though the low mappings were removed at bootup,
      they were left behind (with Global flags helping to keep them in TLB)
      after resume or cpu online, causing the crashes seen.
      
      Reinstate zap_low_mappings (with local __flush_tlb_all) for each cpu_up
      on x86_32.  This used to be serialized by smp_commenced_mask: that's now
      gone, but a low_mappings flag will do.  No need for native_smp_cpus_done
      to repeat the zap: let mem_init zap BSP's low mappings just like on UP.
      
      (In passing, fix error code from native_cpu_up: do_boot_cpu returns a
      variety of diagnostic values, Dprintk what it says but convert to -EIO.
      And save_pg_dir separately before zap_low_mappings: doesn't matter now,
      but zapping twice in succession wiped out resume's swsusp_pg_dir.)
      
      That worked well on the duo and one quad, but wouldn't boot 3rd or 4th
      cpu on P4 Xeon, oopsing just after unlock_ipi_call_lock.  The TLB flush
      IPI now being sent reveals a long-standing bug: the booting cpu has its
      APIC readied in smp_callin at the top of start_secondary, but isn't put
      into the cpu_online_map until just before that unlock_ipi_call_lock.
      
      So native_smp_call_function_mask to online cpus would send_IPI_allbutself,
      including the cpu just coming up, though it has been excluded from the
      count to wait for: by the time it handles the IPI, the call data on
      native_smp_call_function_mask's stack may well have been overwritten.
      
      So fall back to send_IPI_mask while cpu_online_map does not match
      cpu_callout_map: perhaps there's a better APICological fix to be
      made at the start_secondary end, but I wouldn't know that.
      Signed-off-by: NHugh Dickins <hugh@veritas.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      61165d7a
  6. 05 5月, 2008 2 次提交
  7. 29 4月, 2008 1 次提交
  8. 26 4月, 2008 1 次提交
  9. 25 4月, 2008 2 次提交
  10. 20 4月, 2008 1 次提交
  11. 17 4月, 2008 19 次提交