1. 17 Mar, 2016 2 commits
  2. 01 Mar, 2016 1 commit
    • Thomas Gleixner's avatar
      arch/hotplug: Call into idle with a proper state · fc6d73d6
      Thomas Gleixner authored
      Let the non boot cpus call into idle with the corresponding hotplug state, so
      the hotplug core can handle the further bringup. That's a first step to
      convert the boot side of the hotplugged cpus to do all the synchronization
      with the other side through the state machine. For now it'll only start the
      hotplug thread and kick the full bringup of the cpu.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: linux-arch@vger.kernel.org
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Rafael Wysocki <rafael.j.wysocki@intel.com>
      Cc: "Srivatsa S. Bhat" <srivatsa@mit.edu>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Sebastian Siewior <bigeasy@linutronix.de>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul Turner <pjt@google.com>
      Link: http://lkml.kernel.org/r/20160226182341.614102639@linutronix.de
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
  3. 09 Mar, 2015 1 commit
  4. 04 Jun, 2014 1 commit
    • Christoph Lameter's avatar
      sh: Replace __get_cpu_var uses · c473b2c6
      Christoph Lameter authored
      __get_cpu_var() is used for multiple purposes in the kernel source.  One
      of them is address calculation via the form &__get_cpu_var(x).  This
      calculates the address for the instance of the percpu variable of the
      current processor based on an offset.
      Other use cases are for storing and retrieving data from the current
      processors percpu area.  __get_cpu_var() can be used as an lvalue when
      writing data or on the right side of an assignment.
      __get_cpu_var() is defined as :
      #define __get_cpu_var(var) (*this_cpu_ptr(&(var)))
      __get_cpu_var() always only does an address determination.  However, store
      and retrieve operations could use a segment prefix (or global register on
      other platforms) to avoid the address calculation.
      this_cpu_write() and this_cpu_read() can directly take an offset into a
      percpu area and use optimized assembly code to read and write per cpu
      This patch converts __get_cpu_var into either an explicit address
      calculation using this_cpu_ptr() or into a use of this_cpu operations that
      use the offset.  Thereby address calculations are avoided and less
      registers are used when code is generated.
      At the end of the patch set all uses of __get_cpu_var have been removed so
      the macro is removed too.
      The patch set includes passes over all arches as well.  Once these
      operations are used throughout then specialized macros can be defined in
      non -x86 arches as well in order to optimize per cpu access by f.e.  using
      a global register that may be set to the per cpu base.
      Transformations done to __get_cpu_var()
      1. Determine the address of the percpu instance of the current processor.
      	DEFINE_PER_CPU(int, y);
      	int *x = &__get_cpu_var(y);
          Converts to
      	int *x = this_cpu_ptr(&y);
      2. Same as #1 but this time an array structure is involved.
      	DEFINE_PER_CPU(int, y[20]);
      	int *x = __get_cpu_var(y);
          Converts to
      	int *x = this_cpu_ptr(y);
      3. Retrieve the content of the current processors instance of a per cpu
      	DEFINE_PER_CPU(int, y);
      	int x = __get_cpu_var(y)
         Converts to
      	int x = __this_cpu_read(y);
      4. Retrieve the content of a percpu struct
      	DEFINE_PER_CPU(struct mystruct, y);
      	struct mystruct x = __get_cpu_var(y);
         Converts to
      	memcpy(&x, this_cpu_ptr(&y), sizeof(x));
      5. Assignment to a per cpu variable
      	DEFINE_PER_CPU(int, y)
      	__get_cpu_var(y) = x;
         Converts to
      	__this_cpu_write(y, x);
      6. Increment/Decrement etc of a per cpu variable
      	DEFINE_PER_CPU(int, y);
         Converts to
      Signed-off-by: default avatarChristoph Lameter <cl@linux.com>
      Tested-by: Geert Uytterhoeven <geert@linux-m68k.org> [compilation only]
      Cc: Paul Mundt <lethal@linux-sh.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
  5. 14 Jul, 2013 1 commit
    • Paul Gortmaker's avatar
      sh: delete __cpuinit usage from all sh files · 4603f53a
      Paul Gortmaker authored
      The __cpuinit type of throwaway sections might have made sense
      some time ago when RAM was more constrained, but now the savings
      do not offset the cost and complications.  For example, the fix in
      commit 5e427ec2 ("x86: Fix bit corruption at CPU resume time")
      is a good example of the nasty type of bugs that can be created
      with improper use of the various __init prefixes.
      After a discussion on LKML[1] it was decided that cpuinit should go
      the way of devinit and be phased out.  Once all the users are gone,
      we can then finally remove the macros themselves from linux/init.h.
      Note that some harmless section mismatch warnings may result, since
      notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
      are flagged as __cpuinit  -- so if we remove the __cpuinit from
      arch specific callers, we will also get section mismatch warnings.
      As an intermediate step, we intend to turn the linux/init.h cpuinit
      content into no-ops as early as possible, since that will get rid
      of these warnings.  In any case, they are temporary and harmless.
      This removes all the arch/sh uses of the __cpuinit macros from
      all C files.  Currently sh does not have any __CPUINIT used in
      assembly files.
      [1] https://lkml.org/lkml/2013/5/20/589
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: linux-sh@vger.kernel.org
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
  6. 08 Apr, 2013 1 commit
  7. 31 May, 2012 1 commit
  8. 26 Apr, 2012 2 commits
  9. 30 Mar, 2012 1 commit
  10. 28 Mar, 2012 1 commit
  11. 23 Feb, 2012 1 commit
  12. 26 Jul, 2011 1 commit
  13. 14 Apr, 2011 1 commit
  14. 29 Apr, 2010 1 commit
  15. 26 Apr, 2010 5 commits
  16. 20 Apr, 2010 1 commit
  17. 28 Mar, 2010 1 commit
    • Matt Fleming's avatar
      sh: Enable the mmu in start_secondary() · 4bea3418
      Matt Fleming authored
      For the boot, enable_mmu() is called from setup_arch() but we don't call
      setup_arch() for any of the other cpus. So turn on the non-boot cpu's
      mmu inside of start_secondary().
      I noticed this bug on an SMP board when trying to map I/O memory
      (smsc911x registers) into the kernel address space. Since the Address
      Translation bit in MMUCR wasn't set, accessing the virtual address where
      the smsc911x registers were supposedly mapped actually performed a
      physical address access.
      Signed-off-by: default avatarMatt Fleming <matt@console-pimps.org>
      Cc: stable@kernel.org
      Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
  18. 20 Jan, 2010 1 commit
    • Paul Mundt's avatar
      sh: machine_ops based reboot support. · fbb82b03
      Paul Mundt authored
      This provides a machine_ops-based reboot interface loosely cloned from
      x86, and converts the native sh32 and sh64 cases over to it.
      Necessary both for tying in SMP support and also enabling platforms like
      SDK7786 to add support for their microcontroller-based power managers.
      Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
  19. 14 Oct, 2009 1 commit
  20. 13 Oct, 2009 1 commit
  21. 14 Jun, 2009 2 commits
  22. 13 Dec, 2008 2 commits
    • Rusty Russell's avatar
      cpumask: convert struct clock_event_device to cpumask pointers. · 320ab2b0
      Rusty Russell authored
      Impact: change calling convention of existing clock_event APIs
      struct clock_event_timer's cpumask field gets changed to take pointer,
      as does the ->broadcast function.
      Another single-patch change.  For safety, we BUG_ON() in
      clockevents_register_device() if it's not set.
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Cc: Ingo Molnar <mingo@elte.hu>
    • Rusty Russell's avatar
      cpumask: centralize cpu_online_map and cpu_possible_map · 98a79d6a
      Rusty Russell authored
      Impact: cleanup
      Each SMP arch defines these themselves.  Move them to a central
      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'
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Reviewed-by: default avatarGrant Grundler <grundler@parisc-linux.org>
      Tested-by: default avatarTony Luck <tony.luck@intel.com>
      Acked-by: default avatarIngo 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
  23. 20 Oct, 2008 1 commit
  24. 08 Sep, 2008 1 commit
    • Manfred Spraul's avatar
      kernel/cpu.c: create a CPU_STARTING cpu_chain notifier · e545a614
      Manfred Spraul authored
      Right now, there is no notifier that is called on a new cpu, before the new
      cpu begins processing interrupts/softirqs.
      Various kernel function would need that notification, e.g. kvm works around
      by calling smp_call_function_single(), rcu polls cpu_online_map.
      The patch adds a CPU_STARTING notification. It also adds a helper function
      that sends the message to all cpu_chain handlers.
      Tested on x86-64.
      All other archs are untested. Especially on sparc, I'm not sure if I got
      it right.
      Signed-off-by: default avatarManfred Spraul <manfred@colorfullife.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
  25. 07 Sep, 2008 3 commits
  26. 26 Jun, 2008 3 commits
  27. 20 Mar, 2008 1 commit
  28. 21 Sep, 2007 1 commit