aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/pseries/hotplug-cpu.c
diff options
context:
space:
mode:
authorLi Zhong <zhong@linux.vnet.ibm.com>2014-04-27 20:29:51 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-04-27 23:08:47 -0400
commit4fb8d027dca0236c811272d342cf185569d91311 (patch)
tree8bdad33ed82cad9b0947a9974f1d6b694d721cfd /arch/powerpc/platforms/pseries/hotplug-cpu.c
parent28ea3c7529388c1e4177336a0e655c6c7272fd1c (diff)
powerpc: Fix Oops in rtas_stop_self()
commit 41dd03a9 may cause Oops in rtas_stop_self(). The reason is that the rtas_args was moved into stack space. For a box with more that 4GB RAM, the stack could easily be outside 32bit range, but RTAS is 32bit. So the patch moves rtas_args away from stack by adding static before it. Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com> Signed-off-by: Anton Blanchard <anton@samba.org> Cc: stable@vger.kernel.org # 3.14+ Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/pseries/hotplug-cpu.c')
-rw-r--r--arch/powerpc/platforms/pseries/hotplug-cpu.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index 9b8e05078a63..20d62975856f 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -88,13 +88,14 @@ void set_default_offline_state(int cpu)
88 88
89static void rtas_stop_self(void) 89static void rtas_stop_self(void)
90{ 90{
91 struct rtas_args args = { 91 static struct rtas_args args = {
92 .token = cpu_to_be32(rtas_stop_self_token),
93 .nargs = 0, 92 .nargs = 0,
94 .nret = 1, 93 .nret = 1,
95 .rets = &args.args[0], 94 .rets = &args.args[0],
96 }; 95 };
97 96
97 args.token = cpu_to_be32(rtas_stop_self_token);
98
98 local_irq_disable(); 99 local_irq_disable();
99 100
100 BUG_ON(rtas_stop_self_token == RTAS_UNKNOWN_SERVICE); 101 BUG_ON(rtas_stop_self_token == RTAS_UNKNOWN_SERVICE);