History log of /arch/s390/include/asm/smp.h
Revision Date Author Comments
d59b93da5e572703e1a7311c13dd3472a4e56e30 19-Sep-2014 Martin Schwidefsky <schwidefsky@de.ibm.com> s390/rwlock: use directed yield for write-locked rwlocks

Add an owner field to the arch_rwlock_t to be able to pass the timeslice
of a virtual CPU with diagnose 0x9c to the lock owner in case the rwlock
is write-locked. The undirected yield in case the rwlock is acquired
writable but the lock is read-locked is removed.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
f4192bf2dc5ae3b24ffb004e771397e737ef01e0 15-Apr-2014 Michael Holzheu <holzheu@linux.vnet.ibm.com> s390/smp: Avoid busy loop after halt and "begin" on z/VM

Currently the smp_stop_cpu() function for SMP kernels enters a busy
loop when "begin" is entered on the z/VM console after Linux is halted.
To avoid this behavior, use the non-SMP variant of smp_stop_cpu()
which stops the CPU again after "begin" is entered. As a side
effect we now have consistent behavior for SMP and non-SMP Linux.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
e7c46c66dbd1727f7de52f54c4acefb692b24f37 04-Apr-2014 Heiko Carstens <heiko.carstens@de.ibm.com> s390/smp: fix smp_stop_cpu() for !CONFIG_SMP

smp_stop_cpu() should stop the current cpu even for !CONFIG_SMP.
Otherwise machine_halt() will return and and the machine generates a
panic instread of simply stopping the current cpu:

Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000

CPU: 0 PID: 1 Comm: systemd-shutdow Not tainted 3.14.0-01527-g2b6ef16a6bc5 #10
[...]
Call Trace:
([<0000000000110db0>] show_trace+0xf8/0x158)
[<0000000000110e7a>] show_stack+0x6a/0xe8
[<000000000074dba8>] panic+0xe4/0x268
[<0000000000140570>] do_exit+0xa88/0xb2c
[<000000000016e12c>] SyS_reboot+0x1f0/0x234
[<000000000075da70>] sysc_nr_ok+0x22/0x28
[<000000007d5a09b4>] 0x7d5a09b4

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
d80512f87474f2dfd67ef931737659acce20fe69 16-Dec-2013 Heiko Carstens <heiko.carstens@de.ibm.com> s390/smp: improve setup of possible cpu mask

Since under z/VM we cannot have more than 64 cpus, make sure the
cpu_possible_mask does not contain more bits.
This avoids wasting memory for dynamic per-cpu allocations if
CONFIG_NR_CPUS is larger than 64.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
5895294274bee046bcfdbb72f8998e2b14e26426 11-Oct-2013 Michael Holzheu <holzheu@linux.vnet.ibm.com> s390: Remove zfcpdump NR_CPUS dependency

Currently zfpcdump can only collect registers for up to CONFIG_NR_CPUS
CPUss. This dependency is not necessary. So remove it by dynamically
allocating the save area array.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
50ab9a9a60fc83b8e8db36b54f365226e2b139ac 04-Sep-2012 Heiko Carstens <heiko.carstens@de.ibm.com> s390/smp,topology: add polarization member to pcpu struct

The cpu polarization member is the only per cpu state that is not part
of the pcpu structure. So add it there and have everything in one place.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
0d0e471b46d4ba1de4617d04cf071c6ae4a5df76 27-Aug-2012 Heiko Carstens <heiko.carstens@de.ibm.com> s390/smp: fix smp_find_processor_id() argument mismatch

For SMP and !SMP smp_find_processor_id() either takes a u16 or
an unsigned int argument. Fix this so both versions take a u16.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
29a877fa1f402ce2c1a0c52957c4e29b9bb34216 27-Aug-2012 Heiko Carstens <heiko.carstens@de.ibm.com> s390/smp: add missing smp_store_status() for !SMP

Fix this compile error:

arch/s390/kernel/machine_kexec.c: In function ‘setup_regs’:
arch/s390/kernel/machine_kexec.c:63:3: error: implicit declaration
of function ‘smp_store_status’ [-Werror=implicit-function-declaration]

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
a53c8fab3f87c995c30ac226a03af95361243144 20-Jul-2012 Heiko Carstens <heiko.carstens@de.ibm.com> s390/comments: unify copyright messages and remove file names

Remove the file name from the comment at top of many files. In most
cases the file name was wrong anyway, so it's rather pointless.

Also unify the IBM copyright statement. We did have a lot of sightly
different statements and wanted to change them one after another
whenever a file gets touched. However that never happened. Instead
people start to take the old/"wrong" statements to use as a template
for new files.
So unify all of them in one go.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
8239c25f47d2b318156993b15f33900a86ea5e17 20-Apr-2012 Thomas Gleixner <tglx@linutronix.de> smp: Add task_struct argument to __cpu_up()

Preparatory patch to make the idle thread allocation for secondary
cpus generic.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Richard Kuo <rkuo@codeaurora.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Hirokazu Takata <takata@linux-m32r.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: David Howells <dhowells@redhat.com>
Cc: James E.J. Bottomley <jejb@parisc-linux.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: x86@kernel.org
Link: http://lkml.kernel.org/r/20120420124556.964170564@linutronix.de
a0616cdebcfd575dcd4c46102d1b52fbb827fc29 28-Mar-2012 David Howells <dhowells@redhat.com> Disintegrate asm/system.h for S390

Disintegrate asm/system.h for S390.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: linux-s390@vger.kernel.org
8b646bd759086f6090fe27acf414c0b5faa737f4 11-Mar-2012 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] rework smp code

Define struct pcpu and merge some of the NR_CPUS arrays into it, including
__cpu_logical_map, current_set and smp_cpu_state. Split smp related
functions to those operating on physical cpus and the functions operating
on a logical cpu number. Make the functions for physical cpus use a
pointer to a struct pcpu. This hides the knowledge about cpu addresses in
smp.c, entry[64].S and swsusp_asm64.S, thus remove the sigp.h header.

The PSW restart mechanism is used to start secondary cpus, calling a
function on an online cpu, calling a function on the ipl cpu, and for
the nmi signal. Replace the different assembler functions with a
single function restart_int_handler. The new entry point calls a function
whose pointer is stored in the lowcore of the target cpu and it can wait
for the source cpu to stop. This covers all existing use cases.

Overall the code is now simpler and there are ~380 lines less code.

Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
83a24e32908476c33ea9abc132c73020e2cd3620 27-Dec-2011 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] topology: get rid of ifdefs

Remove all ifdefs from topology code and also only compile it for the
CONFIG_SCHED_BOOK case. The new code selects SCHED_MC if SCHED_BOOK is
selected. SCHED_MC without SCHED_BOOK is not possible anymore.
Furthermore various sysfs attributes are not available anymore for the
!SCHED_BOOK case. In particular all attributes that correspond to
CPU polarization.
But since all real world kernels have SCHED_BOOK selected anyway this
doesn't matter too much.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1943f53c9ca182fa233e5a17e89ef8e421d7819e 30-Oct-2011 Michael Holzheu <holzheu@linux.vnet.ibm.com> [S390] Force PSW restart on online CPU

PSW restart can be triggered on offline CPUs. If this happens, currently
the PSW restart code fails, because functions like smp_processor_id()
do not work on offline CPUs. This patch fixes this as follows:

If PSW restart is triggered on an offline CPU, the PSW restart (sigp restart)
is done a second time on another CPU that is online and the old CPU is
stopped afterwards.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
da7f51c11d5fedca9ba779ee220063ccb4f0a27e 05-Jan-2011 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] smp/idle: call init_idle() before starting a new cpu

Call init_idle() which (re-)initializes the idle task structure before
it gets used on a new cpu.
That way we can also get rid of the odd preempt_enable_no_resched()
call we have in the cpu offline path within cpu_idle(). That call
prevented preempt count imbalances between cpu hotplug operations.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
59b697874529f5c3cbcaf5816b3d6c584af521e8 26-Feb-2010 Gerald Schaefer <gerald.schaefer@de.ibm.com> [S390] spinlock: check virtual cpu running status

This patch introduces a new function that checks the running status
of a cpu in a hypervisor. This status is not virtualized, so the check
is only correct if running in an LPAR. On acquiring a spinlock, if the
cpu holding the lock is scheduled by the hypervisor, we do a busy wait
on the lock. If it is not scheduled, we yield over to that cpu.

Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2c2df118a6440748e6fd71a510a66ee708c31494 26-Feb-2010 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] smp: always reboot on cpu 0

Always reboot on logical cpu 0. This makes sure that the IPL cpu is
always the same and usually avoids strange numbering schemes between
physical and logical cpus.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
f64ca21714f114a78b6c19ceabc7745b29913efc 26-Feb-2010 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] zfcpdump: remove cross arch dump support

Remove support to be able to dump 31 bit systems with a 64 bit dumper.
This is mostly useless since no distro ships 31 bit kernels together
with a 64 bit dumper.
We also get rid of a bit of hacky code.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
c20c89a692872a4090b1004e6554fdc282baf72f 07-Dec-2009 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] smp: remove unused typedef and defines

Remove unused typedef, defines, update copyright, remove unneeded
includes, remove unneeded ifdefs.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
0748bd01773395003208996c4c0b3f80caf80976 24-Sep-2009 Rusty Russell <rusty@rustcorp.com.au> cpumask: remove arch_send_call_function_ipi

Now everyone is converted to arch_send_call_function_ipi_mask, remove
the shim and the #defines.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
630cd0460724e286d3c5cb2c33930b0ae9cd6645 24-Sep-2009 Rusty Russell <rusty@rustcorp.com.au> cpumask: arch_send_call_function_ipi_mask: s390

We're weaning the core code off handing cpumask's around on-stack.
This introduces arch_send_call_function_ipi_mask().

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5c0b912e755caaad555eb6feefdb1124462d8f37 11-Sep-2009 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] Remove smp_cpu_not_running.

smp_cpu_not_running() and cpu_stopped() are doing the same.
Remove one and also get rid of the last hard_smp_processor_id() leftover.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
7b4684880dfc6c45bc56039ca5eada771d7643ab 26-Mar-2009 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] eliminate cpuinfo_S390 structure

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
70f454408e68fdba2c2529ab7d6ec3c3525e59f2 20-Mar-2009 Heiko Carstens <heiko.carstens@de.ibm.com> s390: remove arch specific smp_send_stop()

Impact: build fix on s390 !CONFIG_SMP

Remove arch specific smp_send_stop for !CONFIG_SMP since it conflicts
with a new generic version.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
LKML-Reference: <20090320092410.30d2bac3@osiris.boeblingen.de.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
ca9fc75a68ee98812bb6d212405fea039421910b 25-Dec-2008 Heiko Carstens <heiko.carstens@de.ibm.com> [S390] convert s390 to generic IPI infrastructure

Since etr/stp don't need the old smp_call_function semantics anymore
we can convert s390 to the generic IPI infrastructure.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
c6557e7f2b6ae76a44653d38f835174074c42e05 01-Aug-2008 Martin Schwidefsky <schwidefsky@de.ibm.com> [S390] move include/asm-s390 to arch/s390/include/asm

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>