aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorPeter Oberparleiter <peter.oberparleiter@de.ibm.com>2006-06-29 09:08:25 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2006-06-29 09:08:25 -0400
commit585c3047a881d0f54b93a0dd8ab499b07ed25d09 (patch)
tree927b2b4abeb7c9706a958de9917797f2dbbf5445 /arch/s390
parent405455734e1cdec09c37233216f9240cb1a058e5 (diff)
[S390] Add vmpanic parameter.
Implementation of new kernel parameter vmpanic that provides a means to perform a z/VM CP command after a kernel panic occurred. Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kernel/setup.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index 813444aac7d7..2b2551e3510b 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -37,6 +37,7 @@
37#include <linux/seq_file.h> 37#include <linux/seq_file.h>
38#include <linux/kernel_stat.h> 38#include <linux/kernel_stat.h>
39#include <linux/device.h> 39#include <linux/device.h>
40#include <linux/notifier.h>
40 41
41#include <asm/uaccess.h> 42#include <asm/uaccess.h>
42#include <asm/system.h> 43#include <asm/system.h>
@@ -115,6 +116,7 @@ void __devinit cpu_init (void)
115 */ 116 */
116char vmhalt_cmd[128] = ""; 117char vmhalt_cmd[128] = "";
117char vmpoff_cmd[128] = ""; 118char vmpoff_cmd[128] = "";
119char vmpanic_cmd[128] = "";
118 120
119static inline void strncpy_skip_quote(char *dst, char *src, int n) 121static inline void strncpy_skip_quote(char *dst, char *src, int n)
120{ 122{
@@ -146,6 +148,38 @@ static int __init vmpoff_setup(char *str)
146 148
147__setup("vmpoff=", vmpoff_setup); 149__setup("vmpoff=", vmpoff_setup);
148 150
151static int vmpanic_notify(struct notifier_block *self, unsigned long event,
152 void *data)
153{
154 if (MACHINE_IS_VM && strlen(vmpanic_cmd) > 0)
155 cpcmd(vmpanic_cmd, NULL, 0, NULL);
156
157 return NOTIFY_OK;
158}
159
160#define PANIC_PRI_VMPANIC 0
161
162static struct notifier_block vmpanic_nb = {
163 .notifier_call = vmpanic_notify,
164 .priority = PANIC_PRI_VMPANIC
165};
166
167static int __init vmpanic_setup(char *str)
168{
169 static int register_done __initdata = 0;
170
171 strncpy_skip_quote(vmpanic_cmd, str, 127);
172 vmpanic_cmd[127] = 0;
173 if (!register_done) {
174 register_done = 1;
175 atomic_notifier_chain_register(&panic_notifier_list,
176 &vmpanic_nb);
177 }
178 return 1;
179}
180
181__setup("vmpanic=", vmpanic_setup);
182
149/* 183/*
150 * condev= and conmode= setup parameter. 184 * condev= and conmode= setup parameter.
151 */ 185 */