1. 29 8月, 2017 1 次提交
    • M
      MIPS: SMP: Constify smp ops · ff2c8252
      Matt Redfearn 提交于
      smp_ops providers do not modify their ops structures, so they should be
      made const for robustness. Since currently the MIPS kernel is not mapped
      with memory protection, this does not in itself provide any security
      benefit, but it still makes sense to make this change.
      
      There are also slight code size efficincies from the structure being
      made read-only, saving 128 bytes of kernel text on a
      pistachio_defconfig.
      Before:
         text	   data	    bss	    dec	    hex	filename
      7187239	1772752	 470224	9430215	 8fe4c7	vmlinux
      After:
         text	   data	    bss	    dec	    hex	filename
      7187111	1772752	 470224	9430087	 8fe447	vmlinux
      Signed-off-by: NMatt Redfearn <matt.redfearn@imgtec.com>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
      Cc: Bart Van Assche <bart.vanassche@sandisk.com>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Huacai Chen <chenhc@lemote.com>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Doug Ledford <dledford@redhat.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Joe Perches <joe@perches.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Steven J. Hill <steven.hill@cavium.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/16784/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      ff2c8252
  2. 13 7月, 2017 1 次提交
  3. 03 1月, 2017 2 次提交
    • M
      MIPS: kexec: remove SMP_DUMP · c83c2eed
      Marcin Nowakowski 提交于
      SMP_DUMP has been added as a new IPI signal when kexec support was added
      for Cavium Octeon CPUs ('commit 7aa1c8f4 ("MIPS: kdump: Add support")'.
      However, the new signal doesn't appear to ever have a proper handler
      added (octeon_message_functions[] array has an empty handler for it),
      and generic IPI handlers now trigger a BUG() on unhandled signal.
      
      As the method is unused remove it completely and replace its only
      invocation with a smp_call_function().
      
      [ralf@linux-mips.org: Renumber SMP_ASK_C0COUNT to avoid numbering gaps.]
      Signed-off-by: NMarcin Nowakowski <marcin.nowakowski@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/14630/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      c83c2eed
    • M
      MIPS: SMP: Remove cpu_callin_map · 5892d6a6
      Matt Redfearn 提交于
      The previous commit made cpu_callin_map redundant, since it is no longer
      used to signal secondary CPUs starting, or going offline. Remove it now.
      Signed-off-by: NMatt Redfearn <matt.redfearn@imgtec.com>
      Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
      Cc: Qais Yousef <qsyousef@gmail.com>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Huacai Chen <chenhc@lemote.com>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Anna-Maria Gleixner <anna-maria@linutronix.de>
      Cc: Adam Buchbinder <adam.buchbinder@gmail.com>
      Cc: Yang Shi <yang.shi@windriver.com>
      Cc: David Daney <david.daney@cavium.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/14503/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      5892d6a6
  4. 05 10月, 2016 1 次提交
    • M
      MIPS: smp.c: Introduce mechanism for freeing and allocating IPIs · 7688c539
      Matt Redfearn 提交于
      For the MIPS remote processor implementation, we need additional IPIs to
      talk to the remote processor. Since MIPS GIC reserves exactly the right
      number of IPI IRQs required by Linux for the number of VPs in the
      system, this is not possible without releasing some recources.
      
      This commit introduces mips_smp_ipi_allocate() which allocates IPIs to a
      given cpumask. It is called as normal with the cpu_possible_mask at
      bootup to initialise IPIs to all CPUs. mips_smp_ipi_free() may then be
      used to free IPIs to a subset of those CPUs so that their hardware
      resources can be reused.
      Signed-off-by: NMatt Redfearn <matt.redfearn@imgtec.com>
      Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
      Cc: Ohad Ben-Cohen <ohad@wizery.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Lisa Parratt <Lisa.Parratt@imgtec.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Qais Yousef <qsyousef@gmail.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Cc: linux-remoteproc@vger.kernel.org
      Cc: lisa.parratt@imgtec.com
      Cc: linux-kernel@vger.kernel.org
      Patchwork: https://patchwork.linux-mips.org/patch/14285/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      7688c539
  5. 29 7月, 2016 2 次提交
    • J
      MIPS: c-r4k: Exclude sibling CPUs in SMP calls · 640511ae
      James Hogan 提交于
      When performing SMP calls to foreign cores, exclude sibling CPUs from
      the provided map, as we already handle the local core on the current
      CPU. This prevents an SMP call from for example core 0, VPE 1 to VPE 0
      on the same core.
      
      In the process the cpu_foreign_map cpumask is turned into an array of
      cpumasks, so that each CPU has its own version of it which excludes
      sibling CPUs. r4k_op_needs_ipi() is also updated to reflect that cache
      management SMP calls are not needed when all CPUs are siblings (i.e.
      there are no foreign CPUs according to the new cpu_foreign_map[]
      semantics which exclude siblings).
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Leonid Yegoshin <leonid.yegoshin@imgtec.com>
      Cc: Felix Fietkau <nbd@nbd.name>
      Cc: Jayachandran C. <jchandra@broadcom.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/13801/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      640511ae
    • J
      MIPS: SMP: Update cpu_foreign_map on CPU disable · 826e99be
      James Hogan 提交于
      When a CPU is disabled via CPU hotplug, cpu_foreign_map is not updated.
      This could result in cache management SMP calls being sent to offline
      CPUs instead of online siblings in the same core.
      
      Add a call to calculate_cpu_foreign_map() in the various MIPS cpu
      disable callbacks after set_cpu_online(). All cases are updated for
      consistency and to keep cpu_foreign_map strictly up to date, not just
      those which may support hardware multithreading.
      
      Fixes: cccf34e9 ("MIPS: c-r4k: Fix cache flushing for MT cores")
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: David Daney <david.daney@cavium.com>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Huacai Chen <chenhc@lemote.com>
      Cc: Hongliang Tao <taohl@lemote.com>
      Cc: Hua Yan <yanh@lemote.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/13799/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      826e99be
  6. 03 8月, 2015 1 次提交
    • A
      MIPS: SMP: Don't increment irq_count multiple times for call function IPIs · 4ace6139
      Alex Smith 提交于
      The majority of SMP platforms handle their IPIs through do_IRQ()
      which calls irq_{enter/exit}(). When a call function IPI is received,
      smp_call_function_interrupt() is called which also calls
      irq_{enter,exit}(), meaning irq_count is raised twice.
      
      When tick broadcasting is used (which is implemented via a call
      function IPI), this incorrectly causes all CPU idle time on the core
      receiving broadcast ticks to be accounted as time spent servicing
      IRQs, as account_process_tick() will account as such if irq_count is
      greater than 1. This results in 100% CPU usage being reported on a
      core which receives its ticks via broadcast.
      
      This patch removes the SMP smp_call_function_interrupt() wrapper which
      calls irq_{enter,exit}(). Platforms which handle their IPIs through
      do_IRQ() now call generic_smp_call_function_interrupt() directly to
      avoid incrementing irq_count a second time. Platforms which don't
      (loongson, sgi-ip27, sibyte) call generic_smp_call_function_interrupt()
      wrapped in irq_{enter,exit}().
      Signed-off-by: NAlex Smith <alex.smith@imgtec.com>
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/10770/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      4ace6139
  7. 10 7月, 2015 1 次提交
    • M
      MIPS: c-r4k: Fix cache flushing for MT cores · cccf34e9
      Markos Chandras 提交于
      MT_SMP is not the only SMP option for MT cores. The MT_SMP option
      allows more than one VPE per core to appear as a secondary CPU in the
      system. Because of how CM works, it propagates the address-based
      cache ops to the secondary cores but not the index-based ones.
      Because of that, the code does not use IPIs to flush the L1 caches on
      secondary cores because the CM would have done that already. However,
      the CM functionality is independent of the type of SMP kernel so even in
      non-MT kernels, IPIs are not necessary. As a result of which, we change
      the conditional to depend on the CM presence. Moreover, since VPEs on
      the same core share the same L1 caches, there is no need to send an
      IPI on all of them so we calculate a suitable cpumask with only one
      VPE per core.
      Signed-off-by: NMarkos Chandras <markos.chandras@imgtec.com>
      Cc: <stable@vger.kernel.org> # 3.15+
      Cc: linux-mips@linux-mips.org
      Patchwork: https://patchwork.linux-mips.org/patch/10654/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      cccf34e9
  8. 12 5月, 2015 1 次提交
    • R
      MIPS: SMP: Fix build error. · cafb45b2
      Ralf Baechle 提交于
        CC      arch/mips/kernel/smp.o
      arch/mips/kernel/smp.c: In function ‘start_secondary’:
      arch/mips/kernel/smp.c:149:2: error: passing argument 2 of ‘cpumask_set_cpu’ discards ‘volatile’ qualifier from pointer target type [-Werror]
        cpumask_set_cpu(cpu, &cpu_callin_map);
        ^
      In file included from ./arch/mips/include/asm/processor.h:14:0,
                       from ./arch/mips/include/asm/thread_info.h:15,
                       from include/linux/thread_info.h:54,
                       from include/asm-generic/preempt.h:4,
                       from arch/mips/include/generated/asm/preempt.h:1,
                       from include/linux/preempt.h:18,
                       from include/linux/interrupt.h:8,
                       from arch/mips/kernel/smp.c:24:
      include/linux/cpumask.h:272:91: note: expected ‘struct cpumask *’ but argument is of type ‘volatile struct cpumask_t *’
       static inline void cpumask_set_cpu(unsigned int cpu, struct cpumask *dstp)
                                                                                                 ^
      arch/mips/kernel/smp.c: In function ‘smp_prepare_boot_cpu’:
      arch/mips/kernel/smp.c:211:2: error: passing argument 2 of ‘cpumask_set_cpu’ discards ‘volatile’ qualifier from pointer target type [-Werror]
        cpumask_set_cpu(0, &cpu_callin_map);
        ^
      In file included from ./arch/mips/include/asm/processor.h:14:0,
                       from ./arch/mips/include/asm/thread_info.h:15,
                       from include/linux/thread_info.h:54,
                       from include/asm-generic/preempt.h:4,
                       from arch/mips/include/generated/asm/preempt.h:1,
                       from include/linux/preempt.h:18,
                       from include/linux/interrupt.h:8,
                       from arch/mips/kernel/smp.c:24:
      include/linux/cpumask.h:272:91: note: expected ‘struct cpumask *’ but argument is of type ‘volatile struct cpumask_t *’
       static inline void cpumask_set_cpu(unsigned int cpu, struct cpumask *dstp)
                                                                                                 ^
      arch/mips/kernel/smp.c: In function ‘__cpu_up’:
      arch/mips/kernel/smp.c:221:10: error: passing argument 2 of ‘cpumask_test_cpu’ discards ‘volatile’ qualifier from pointer target type [-Werror]
        while (!cpumask_test_cpu(cpu, &cpu_callin_map))
                ^
      In file included from ./arch/mips/include/asm/processor.h:14:0,
                       from ./arch/mips/include/asm/thread_info.h:15,
                       from include/linux/thread_info.h:54,
                       from include/asm-generic/preempt.h:4,
                       from arch/mips/include/generated/asm/preempt.h:1,
                       from include/linux/preempt.h:18,
                       from include/linux/interrupt.h:8,
                       from arch/mips/kernel/smp.c:24:
      include/linux/cpumask.h:294:90: note: expected ‘const struct cpumask *’ but argument is of type ‘volatile struct cpumask_t *’
       static inline int cpumask_test_cpu(int cpu, const struct cpumask *cpumask)
                                                                                                ^
      cc1: all warnings being treated as errors
      make[2]: *** [arch/mips/kernel/smp.o] Error 1
      make[1]: *** [arch/mips/kernel] Error 2
      make: *** [arch/mips] Error 2
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      cafb45b2
  9. 10 3月, 2015 1 次提交
  10. 27 8月, 2014 1 次提交
  11. 31 7月, 2014 1 次提交
  12. 02 5月, 2014 1 次提交
    • P
      MIPS: introduce cpu_coherent_mask · 76306f42
      Paul Burton 提交于
      Add a mask of CPUs which are currently known to be operating coherently.
      This is setup initially to be all present CPUs, but in a subsequent
      patch CPUs in a MIPS Coherent Processing System will be cleared in this
      mask as they enter non-coherent idle states. This will be used in order
      to determine when a CPU within a CPS system may need to be powered back
      up, but may also be used in future to optimise away wakeups for cache
      operations or TLB invalidations.
      Signed-off-by: NPaul Burton <paul.burton@imgtec.com>
      76306f42
  13. 01 4月, 2014 1 次提交
  14. 01 2月, 2013 1 次提交
  15. 13 12月, 2012 1 次提交
  16. 27 7月, 2011 1 次提交
  17. 01 10月, 2009 1 次提交
  18. 24 9月, 2009 2 次提交
  19. 25 6月, 2009 3 次提交
  20. 11 1月, 2009 1 次提交
  21. 13 12月, 2008 1 次提交
    • R
      cpumask: centralize cpu_online_map and cpu_possible_map · 98a79d6a
      Rusty Russell 提交于
      Impact: cleanup
      
      Each SMP arch defines these themselves.  Move them to a central
      location.
      
      Twists:
      1) Some archs (m32, parisc, s390) set possible_map to all 1, so we add a
         CONFIG_INIT_ALL_POSSIBLE for this rather than break them.
      
      2) mips and sparc32 '#define cpu_possible_map phys_cpu_present_map'.
         Those archs simply have phys_cpu_present_map replaced everywhere.
      
      3) Alpha defined cpu_possible_map to cpu_present_map; this is tricky
         so I just manipulate them both in sync.
      
      4) IA64, cris and m32r have gratuitous 'extern cpumask_t cpu_possible_map'
         declarations.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Reviewed-by: NGrant Grundler <grundler@parisc-linux.org>
      Tested-by: NTony Luck <tony.luck@intel.com>
      Acked-by: NIngo Molnar <mingo@elte.hu>
      Cc: Mike Travis <travis@sgi.com>
      Cc: ink@jurassic.park.msu.ru
      Cc: rmk@arm.linux.org.uk
      Cc: starvik@axis.com
      Cc: tony.luck@intel.com
      Cc: takata@linux-m32r.org
      Cc: ralf@linux-mips.org
      Cc: grundler@parisc-linux.org
      Cc: paulus@samba.org
      Cc: schwidefsky@de.ibm.com
      Cc: lethal@linux-sh.org
      Cc: wli@holomorphy.com
      Cc: davem@davemloft.net
      Cc: jdike@addtoit.com
      Cc: mingo@redhat.com
      98a79d6a
  22. 11 10月, 2008 1 次提交
  23. 26 6月, 2008 1 次提交
    • J
      mips: convert to generic helpers for IPI function calls · 2f304c0a
      Jens Axboe 提交于
      This converts mips to use the new helpers for smp_call_function() and
      friends, and adds support for smp_call_function_single(). Not tested,
      but it compiles.
      
      mips shares the same IPI for smp_call_function() and
      smp_call_function_single(), since not all mips platforms have enough
      available IPIs to support seperate setups.
      
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
      2f304c0a
  24. 29 1月, 2008 2 次提交
  25. 12 10月, 2007 1 次提交
  26. 11 7月, 2007 1 次提交
  27. 06 6月, 2006 2 次提交
  28. 26 4月, 2006 1 次提交
  29. 28 2月, 2006 1 次提交
    • R
      [MIPS] SMP: Fix initialization order bug. · 9b6695a8
      Ralf Baechle 提交于
          
      A recent change requires cpu_possible_map to be initialized before
      smp_sched_init() but most MIPS platforms were initializing their
      processors in the prom_prepare_cpus callback of smp_prepare_cpus.  The
      simple fix of calling prom_prepare_cpus from one of the earlier SMP
      initialization hooks doesn't work well either since IPIs may require
      init_IRQ() to have completed, so bit the bullet and split
      prom_prepare_cpus into two initialization functions, plat_smp_setup
      which is called early from setup_arch and plat_prepare_cpus called where
      prom_prepare_cpus used to be called.
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      9b6695a8
  30. 22 6月, 2005 1 次提交
    • I
      [PATCH] smp_processor_id() cleanup · 39c715b7
      Ingo Molnar 提交于
      This patch implements a number of smp_processor_id() cleanup ideas that
      Arjan van de Ven and I came up with.
      
      The previous __smp_processor_id/_smp_processor_id/smp_processor_id API
      spaghetti was hard to follow both on the implementational and on the
      usage side.
      
      Some of the complexity arose from picking wrong names, some of the
      complexity comes from the fact that not all architectures defined
      __smp_processor_id.
      
      In the new code, there are two externally visible symbols:
      
       - smp_processor_id(): debug variant.
      
       - raw_smp_processor_id(): nondebug variant. Replaces all existing
         uses of _smp_processor_id() and __smp_processor_id(). Defined
         by every SMP architecture in include/asm-*/smp.h.
      
      There is one new internal symbol, dependent on DEBUG_PREEMPT:
      
       - debug_smp_processor_id(): internal debug variant, mapped to
                                   smp_processor_id().
      
      Also, i moved debug_smp_processor_id() from lib/kernel_lock.c into a new
      lib/smp_processor_id.c file.  All related comments got updated and/or
      clarified.
      
      I have build/boot tested the following 8 .config combinations on x86:
      
       {SMP,UP} x {PREEMPT,!PREEMPT} x {DEBUG_PREEMPT,!DEBUG_PREEMPT}
      
      I have also build/boot tested x64 on UP/PREEMPT/DEBUG_PREEMPT.  (Other
      architectures are untested, but should work just fine.)
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NArjan van de Ven <arjan@infradead.org>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      39c715b7
  31. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4