History log of /arch/metag/kernel/smp.c
Revision Date Author Comments
e9a1d0165bbda4398d4a5d71736cf6390fb42c6f 03-Jan-2014 Geert Uytterhoeven <geert+renesas@linux-m68k.org> metag/smp: Make boot_secondary() static

boot_secondary() is not used outside arch/metag/kernel/smp.c, hence make it
static.

Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
1d61cf121d7d9085145553294307e81c25586288 04-Dec-2013 Jiang Liu <liuj97@gmail.com> smp, metag: kill SMP single function call interrupt

Commit 9a46ad6d6df3 "smp: make smp_call_function_many() use logic
similar to smp_call_function_single()" has unified the way to handle
single and multiple cross-CPU function calls. Now only one interrupt is
needed for architecture specific code to support generic SMP function
call interfaces, so kill the redundant single function call interrupt.

Signed-off-by: Jiang Liu <liuj97@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Shaohua Li <shli@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Jiri Kosina <trivial@kernel.org>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
5a25f7bb5aa1b2f876d9df81c44b516e015022f8 25-Nov-2013 James Hogan <james.hogan@imgtec.com> metag: smp: don't set irq regs in do_IPI()

Since commit f6b30d32d242 (metag: kick: add missing irq_enter/exit to
kick_handler()), the main kick_handler() function deals with setting and
restoring the irq registers pointer. Therefore do_IPI() which is called
indirectly from kick_handler() doesn't need to do that itself any
longer. Therefore remove that code and do_IPI()'s pt_regs argument.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-metag@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>
54be16e7b2c96793bee4bf472409e9d31bc77c78 18-Jun-2013 Paul Gortmaker <paul.gortmaker@windriver.com> metag: delete __cpuinit usage from all metag files

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 5e427ec2d0 ("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/metag uses of the __cpuinit macros from
all C files. Currently metag does not have any __CPUINIT used in
assembly files.

[1] https://lkml.org/lkml/2013/5/20/589

Cc: James Hogan <james.hogan@imgtec.com>
Acked-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
9649814432faa9016952895684120942da0d8481 28-Jun-2013 James Hogan <james.hogan@imgtec.com> metag: smp: don't spin waiting for CPU to start

Use a completion to block until a secondary CPU has started up, like ARM
do, instead of a loop of udelays.

On Meta, SMP is really SMT, with each "CPU" being a different hardware
thread on the same Meta processor core, so as well as being more
efficient and latency friendly, using a completion prevents the bogomips
of the secondary CPU from being drastically skewed every time by the
execution of the tight in-cache udelay loop on the other CPU.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
234c7f1ac109ad1af4ae410463d03ccebf3d6657 28-Jun-2013 James Hogan <james.hogan@imgtec.com> metag: smp: enable irqs after set_cpu_online

In secondary_start_kernel() interrupts should be enabled with
local_irq_enable() after the cpu is marked as online with
set_cpu_online(). Otherwise it's possible for a timer interrupt to
trigger a softirq, which if the cpu is marked as offline may have it's
affinity altered.

Reported-by: Kirill Tkhai <tkhai@yandex.ru>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
Cc: Kirill Tkhai <tkhai@yandex.ru>
42748752f6ada54faa4f39fa471dabce62eaa79a 28-Jun-2013 James Hogan <james.hogan@imgtec.com> metag: use clear_tasks_mm_cpumask()

Checking for process->mm is not enough because process' main thread may
exit or detach its mm via use_mm(), but other threads may still have a
valid mm.

To fix this we would need to use find_lock_task_mm(), which would walk
up all threads and returns an appropriate task (with task lock held).

clear_tasks_mm_cpumask() was introduced in v3.5-rc1 to fix this issue,
so let's use it for metag too.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Anton Vorontsov <anton.vorontsov@linaro.org>
f43b059d8dfb90f7c87b88eff0a57f5a79dd87ff 24-Jun-2013 James Hogan <james.hogan@imgtec.com> metag: don't check for cache aliasing on smp cpu boot

The cache configuration of the boot cpu is now duplicated to secondary
cpus, so there's no need to check for cache aliasing again when a
secondary cpu is booted. Therefore remove the check from
secondary_start_kernel().

Signed-off-by: James Hogan <james.hogan@imgtec.com>
d1dba0fcd3e62f32d5925bcb91eba8757951464c 21-Mar-2013 Thomas Gleixner <tglx@linutronix.de> metag: Use generic idle loop

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Paul McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Reviewed-by: Cc: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Cc: Magnus Damm <magnus.damm@gmail.com>
Cc: James Hogan <james.hogan@imgtec.com>
Link: http://lkml.kernel.org/r/20130321215234.606480852@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
9e7129630329d50b8e8c3403bb71c85a7c3cbe35 07-Mar-2013 James Hogan <james.hogan@imgtec.com> metag: smp: copy cache partition and enable GCOn

When starting an SMP hardware thread, copy the cache partition
configuration so that the threads share the same cache partitions. Also
enable the GCOn bit if running in the local half of the virtual address
space to enable coherency of shared local cache partitions. An atomic
unlock system event is executed by the new cpu before any memory is read
to ensure that any writes made by the boot cpu prior to full coherency
taking effect are visible to the new cpu.

This is to allow SMP to work even when the bootloader hasn't configured
the caches for coherency. A log message is printed to describe the cache
partition changes so that the user is aware of potential unintentional
cache wastage if they've configured the cache partitions in the wrong
way.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
3d6b7bb0a2c518d24bc3036f9bbb6f3fb35462c3 31-Jan-2013 James Hogan <james.hogan@imgtec.com> metag: protect more non-MMU memory regions

Rename setup_txprivext() to setup_priv() and add initialisation of some
more per-thread privilege protection registers:

- TxPRIVSYSR: 0x04400000-0x047fffff
0x05000000-0x07ffffff
0x84000000-0x87ffffff
- TxPIOREG: 0x02000000-0x02ffffff
0x04800000-0x048fffff
- TxSYREG: 0x04000000-0x04000fff (except write fetch system event)

Signed-off-by: James Hogan <james.hogan@imgtec.com>
42682c6c42a5765b2c7cccfca170368fef6191ef 05-Oct-2012 James Hogan <james.hogan@imgtec.com> metag: SMP support

Add SMP support for metag. This allows Linux to take control of multiple
hardware threads on a single Meta core, treating them as separate Linux
CPUs.

Signed-off-by: James Hogan <james.hogan@imgtec.com>