aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/s390/appldata/appldata.h24
-rw-r--r--arch/s390/appldata/appldata_base.c42
-rw-r--r--arch/s390/appldata/appldata_mem.c5
-rw-r--r--arch/s390/appldata/appldata_net_sum.c5
-rw-r--r--arch/s390/appldata/appldata_os.c98
-rw-r--r--arch/s390/kernel/binfmt_elf32.c5
-rw-r--r--arch/s390/kernel/entry.S80
-rw-r--r--arch/s390/kernel/entry64.S80
-rw-r--r--arch/s390/kernel/head.S22
-rw-r--r--arch/s390/kernel/head31.S77
-rw-r--r--arch/s390/kernel/head64.S79
-rw-r--r--arch/s390/kernel/s390_ksyms.c2
-rw-r--r--arch/s390/kernel/setup.c55
-rw-r--r--arch/s390/kernel/traps.c8
14 files changed, 368 insertions, 214 deletions
diff --git a/arch/s390/appldata/appldata.h b/arch/s390/appldata/appldata.h
index e806a8922bbb..71d65eb30650 100644
--- a/arch/s390/appldata/appldata.h
+++ b/arch/s390/appldata/appldata.h
@@ -3,9 +3,9 @@
3 * 3 *
4 * Definitions and interface for Linux - z/VM Monitor Stream. 4 * Definitions and interface for Linux - z/VM Monitor Stream.
5 * 5 *
6 * Copyright (C) 2003 IBM Corporation, IBM Deutschland Entwicklung GmbH. 6 * Copyright (C) 2003,2006 IBM Corporation, IBM Deutschland Entwicklung GmbH.
7 * 7 *
8 * Author: Gerald Schaefer <geraldsc@de.ibm.com> 8 * Author: Gerald Schaefer <gerald.schaefer@de.ibm.com>
9 */ 9 */
10 10
11//#define APPLDATA_DEBUG /* Debug messages on/off */ 11//#define APPLDATA_DEBUG /* Debug messages on/off */
@@ -29,6 +29,22 @@
29#define CTL_APPLDATA_NET_SUM 2125 29#define CTL_APPLDATA_NET_SUM 2125
30#define CTL_APPLDATA_PROC 2126 30#define CTL_APPLDATA_PROC 2126
31 31
32#ifndef CONFIG_64BIT
33
34#define APPLDATA_START_INTERVAL_REC 0x00 /* Function codes for */
35#define APPLDATA_STOP_REC 0x01 /* DIAG 0xDC */
36#define APPLDATA_GEN_EVENT_RECORD 0x02
37#define APPLDATA_START_CONFIG_REC 0x03
38
39#else
40
41#define APPLDATA_START_INTERVAL_REC 0x80
42#define APPLDATA_STOP_REC 0x81
43#define APPLDATA_GEN_EVENT_RECORD 0x82
44#define APPLDATA_START_CONFIG_REC 0x83
45
46#endif /* CONFIG_64BIT */
47
32#define P_INFO(x...) printk(KERN_INFO MY_PRINT_NAME " info: " x) 48#define P_INFO(x...) printk(KERN_INFO MY_PRINT_NAME " info: " x)
33#define P_ERROR(x...) printk(KERN_ERR MY_PRINT_NAME " error: " x) 49#define P_ERROR(x...) printk(KERN_ERR MY_PRINT_NAME " error: " x)
34#define P_WARNING(x...) printk(KERN_WARNING MY_PRINT_NAME " status: " x) 50#define P_WARNING(x...) printk(KERN_WARNING MY_PRINT_NAME " status: " x)
@@ -53,7 +69,11 @@ struct appldata_ops {
53 void *data; /* record data */ 69 void *data; /* record data */
54 unsigned int size; /* size of record */ 70 unsigned int size; /* size of record */
55 struct module *owner; /* THIS_MODULE */ 71 struct module *owner; /* THIS_MODULE */
72 char mod_lvl[2]; /* modification level, EBCDIC */
56}; 73};
57 74
58extern int appldata_register_ops(struct appldata_ops *ops); 75extern int appldata_register_ops(struct appldata_ops *ops);
59extern void appldata_unregister_ops(struct appldata_ops *ops); 76extern void appldata_unregister_ops(struct appldata_ops *ops);
77extern int appldata_diag(char record_nr, u16 function, unsigned long buffer,
78 u16 length, char *mod_lvl);
79
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
index 54d35c130907..61bc44626c04 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -5,9 +5,9 @@
5 * Exports appldata_register_ops() and appldata_unregister_ops() for the 5 * Exports appldata_register_ops() and appldata_unregister_ops() for the
6 * data gathering modules. 6 * data gathering modules.
7 * 7 *
8 * Copyright (C) 2003 IBM Corporation, IBM Deutschland Entwicklung GmbH. 8 * Copyright (C) 2003,2006 IBM Corporation, IBM Deutschland Entwicklung GmbH.
9 * 9 *
10 * Author: Gerald Schaefer <geraldsc@de.ibm.com> 10 * Author: Gerald Schaefer <gerald.schaefer@de.ibm.com>
11 */ 11 */
12 12
13#include <linux/config.h> 13#include <linux/config.h>
@@ -40,22 +40,6 @@
40 40
41#define TOD_MICRO 0x01000 /* nr. of TOD clock units 41#define TOD_MICRO 0x01000 /* nr. of TOD clock units
42 for 1 microsecond */ 42 for 1 microsecond */
43#ifndef CONFIG_64BIT
44
45#define APPLDATA_START_INTERVAL_REC 0x00 /* Function codes for */
46#define APPLDATA_STOP_REC 0x01 /* DIAG 0xDC */
47#define APPLDATA_GEN_EVENT_RECORD 0x02
48#define APPLDATA_START_CONFIG_REC 0x03
49
50#else
51
52#define APPLDATA_START_INTERVAL_REC 0x80
53#define APPLDATA_STOP_REC 0x81
54#define APPLDATA_GEN_EVENT_RECORD 0x82
55#define APPLDATA_START_CONFIG_REC 0x83
56
57#endif /* CONFIG_64BIT */
58
59 43
60/* 44/*
61 * Parameter list for DIAGNOSE X'DC' 45 * Parameter list for DIAGNOSE X'DC'
@@ -195,8 +179,8 @@ static void appldata_work_fn(void *data)
195 * 179 *
196 * prepare parameter list, issue DIAG 0xDC 180 * prepare parameter list, issue DIAG 0xDC
197 */ 181 */
198static int appldata_diag(char record_nr, u16 function, unsigned long buffer, 182int appldata_diag(char record_nr, u16 function, unsigned long buffer,
199 u16 length) 183 u16 length, char *mod_lvl)
200{ 184{
201 unsigned long ry; 185 unsigned long ry;
202 struct appldata_product_id { 186 struct appldata_product_id {
@@ -214,7 +198,7 @@ static int appldata_diag(char record_nr, u16 function, unsigned long buffer,
214 .record_nr = record_nr, 198 .record_nr = record_nr,
215 .version_nr = {0xF2, 0xF6}, /* "26" */ 199 .version_nr = {0xF2, 0xF6}, /* "26" */
216 .release_nr = {0xF0, 0xF1}, /* "01" */ 200 .release_nr = {0xF0, 0xF1}, /* "01" */
217 .mod_lvl = {0xF0, 0xF0}, /* "00" */ 201 .mod_lvl = {mod_lvl[0], mod_lvl[1]},
218 }; 202 };
219 struct appldata_parameter_list appldata_parameter_list = { 203 struct appldata_parameter_list appldata_parameter_list = {
220 .diag = 0xDC, 204 .diag = 0xDC,
@@ -467,24 +451,25 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
467 module_put(ops->owner); 451 module_put(ops->owner);
468 return -ENODEV; 452 return -ENODEV;
469 } 453 }
470 ops->active = 1;
471 ops->callback(ops->data); // init record 454 ops->callback(ops->data); // init record
472 rc = appldata_diag(ops->record_nr, 455 rc = appldata_diag(ops->record_nr,
473 APPLDATA_START_INTERVAL_REC, 456 APPLDATA_START_INTERVAL_REC,
474 (unsigned long) ops->data, ops->size); 457 (unsigned long) ops->data, ops->size,
458 ops->mod_lvl);
475 if (rc != 0) { 459 if (rc != 0) {
476 P_ERROR("START DIAG 0xDC for %s failed, " 460 P_ERROR("START DIAG 0xDC for %s failed, "
477 "return code: %d\n", ops->name, rc); 461 "return code: %d\n", ops->name, rc);
478 module_put(ops->owner); 462 module_put(ops->owner);
479 ops->active = 0;
480 } else { 463 } else {
481 P_INFO("Monitoring %s data enabled, " 464 P_INFO("Monitoring %s data enabled, "
482 "DIAG 0xDC started.\n", ops->name); 465 "DIAG 0xDC started.\n", ops->name);
466 ops->active = 1;
483 } 467 }
484 } else if ((buf[0] == '0') && (ops->active == 1)) { 468 } else if ((buf[0] == '0') && (ops->active == 1)) {
485 ops->active = 0; 469 ops->active = 0;
486 rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC, 470 rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC,
487 (unsigned long) ops->data, ops->size); 471 (unsigned long) ops->data, ops->size,
472 ops->mod_lvl);
488 if (rc != 0) { 473 if (rc != 0) {
489 P_ERROR("STOP DIAG 0xDC for %s failed, " 474 P_ERROR("STOP DIAG 0xDC for %s failed, "
490 "return code: %d\n", ops->name, rc); 475 "return code: %d\n", ops->name, rc);
@@ -633,7 +618,7 @@ appldata_offline_cpu(int cpu)
633 spin_unlock(&appldata_timer_lock); 618 spin_unlock(&appldata_timer_lock);
634} 619}
635 620
636static int 621static int __cpuinit
637appldata_cpu_notify(struct notifier_block *self, 622appldata_cpu_notify(struct notifier_block *self,
638 unsigned long action, void *hcpu) 623 unsigned long action, void *hcpu)
639{ 624{
@@ -710,7 +695,8 @@ static void __exit appldata_exit(void)
710 list_for_each(lh, &appldata_ops_list) { 695 list_for_each(lh, &appldata_ops_list) {
711 ops = list_entry(lh, struct appldata_ops, list); 696 ops = list_entry(lh, struct appldata_ops, list);
712 rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC, 697 rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC,
713 (unsigned long) ops->data, ops->size); 698 (unsigned long) ops->data, ops->size,
699 ops->mod_lvl);
714 if (rc != 0) { 700 if (rc != 0) {
715 P_ERROR("STOP DIAG 0xDC for %s failed, " 701 P_ERROR("STOP DIAG 0xDC for %s failed, "
716 "return code: %d\n", ops->name, rc); 702 "return code: %d\n", ops->name, rc);
@@ -739,6 +725,7 @@ MODULE_DESCRIPTION("Linux-VM Monitor Stream, base infrastructure");
739 725
740EXPORT_SYMBOL_GPL(appldata_register_ops); 726EXPORT_SYMBOL_GPL(appldata_register_ops);
741EXPORT_SYMBOL_GPL(appldata_unregister_ops); 727EXPORT_SYMBOL_GPL(appldata_unregister_ops);
728EXPORT_SYMBOL_GPL(appldata_diag);
742 729
743#ifdef MODULE 730#ifdef MODULE
744/* 731/*
@@ -779,7 +766,6 @@ unsigned long nr_iowait(void)
779#endif /* MODULE */ 766#endif /* MODULE */
780EXPORT_SYMBOL_GPL(si_swapinfo); 767EXPORT_SYMBOL_GPL(si_swapinfo);
781EXPORT_SYMBOL_GPL(nr_threads); 768EXPORT_SYMBOL_GPL(nr_threads);
782EXPORT_SYMBOL_GPL(avenrun);
783EXPORT_SYMBOL_GPL(get_full_page_state); 769EXPORT_SYMBOL_GPL(get_full_page_state);
784EXPORT_SYMBOL_GPL(nr_running); 770EXPORT_SYMBOL_GPL(nr_running);
785EXPORT_SYMBOL_GPL(nr_iowait); 771EXPORT_SYMBOL_GPL(nr_iowait);
diff --git a/arch/s390/appldata/appldata_mem.c b/arch/s390/appldata/appldata_mem.c
index f0e2fbed3d4c..7915a197d96d 100644
--- a/arch/s390/appldata/appldata_mem.c
+++ b/arch/s390/appldata/appldata_mem.c
@@ -4,9 +4,9 @@
4 * Data gathering module for Linux-VM Monitor Stream, Stage 1. 4 * Data gathering module for Linux-VM Monitor Stream, Stage 1.
5 * Collects data related to memory management. 5 * Collects data related to memory management.
6 * 6 *
7 * Copyright (C) 2003 IBM Corporation, IBM Deutschland Entwicklung GmbH. 7 * Copyright (C) 2003,2006 IBM Corporation, IBM Deutschland Entwicklung GmbH.
8 * 8 *
9 * Author: Gerald Schaefer <geraldsc@de.ibm.com> 9 * Author: Gerald Schaefer <gerald.schaefer@de.ibm.com>
10 */ 10 */
11 11
12#include <linux/config.h> 12#include <linux/config.h>
@@ -152,6 +152,7 @@ static struct appldata_ops ops = {
152 .callback = &appldata_get_mem_data, 152 .callback = &appldata_get_mem_data,
153 .data = &appldata_mem_data, 153 .data = &appldata_mem_data,
154 .owner = THIS_MODULE, 154 .owner = THIS_MODULE,
155 .mod_lvl = {0xF0, 0xF0}, /* EBCDIC "00" */
155}; 156};
156 157
157 158
diff --git a/arch/s390/appldata/appldata_net_sum.c b/arch/s390/appldata/appldata_net_sum.c
index 2a4c7432db4a..39b7bdecbf05 100644
--- a/arch/s390/appldata/appldata_net_sum.c
+++ b/arch/s390/appldata/appldata_net_sum.c
@@ -5,9 +5,9 @@
5 * Collects accumulated network statistics (Packets received/transmitted, 5 * Collects accumulated network statistics (Packets received/transmitted,
6 * dropped, errors, ...). 6 * dropped, errors, ...).
7 * 7 *
8 * Copyright (C) 2003 IBM Corporation, IBM Deutschland Entwicklung GmbH. 8 * Copyright (C) 2003,2006 IBM Corporation, IBM Deutschland Entwicklung GmbH.
9 * 9 *
10 * Author: Gerald Schaefer <geraldsc@de.ibm.com> 10 * Author: Gerald Schaefer <gerald.schaefer@de.ibm.com>
11 */ 11 */
12 12
13#include <linux/config.h> 13#include <linux/config.h>
@@ -152,6 +152,7 @@ static struct appldata_ops ops = {
152 .callback = &appldata_get_net_sum_data, 152 .callback = &appldata_get_net_sum_data,
153 .data = &appldata_net_sum_data, 153 .data = &appldata_net_sum_data,
154 .owner = THIS_MODULE, 154 .owner = THIS_MODULE,
155 .mod_lvl = {0xF0, 0xF0}, /* EBCDIC "00" */
155}; 156};
156 157
157 158
diff --git a/arch/s390/appldata/appldata_os.c b/arch/s390/appldata/appldata_os.c
index 99ddd3bf2fba..f2b44a2f1dec 100644
--- a/arch/s390/appldata/appldata_os.c
+++ b/arch/s390/appldata/appldata_os.c
@@ -4,9 +4,9 @@
4 * Data gathering module for Linux-VM Monitor Stream, Stage 1. 4 * Data gathering module for Linux-VM Monitor Stream, Stage 1.
5 * Collects misc. OS related data (CPU utilization, running processes). 5 * Collects misc. OS related data (CPU utilization, running processes).
6 * 6 *
7 * Copyright (C) 2003 IBM Corporation, IBM Deutschland Entwicklung GmbH. 7 * Copyright (C) 2003,2006 IBM Corporation, IBM Deutschland Entwicklung GmbH.
8 * 8 *
9 * Author: Gerald Schaefer <geraldsc@de.ibm.com> 9 * Author: Gerald Schaefer <gerald.schaefer@de.ibm.com>
10 */ 10 */
11 11
12#include <linux/config.h> 12#include <linux/config.h>
@@ -44,11 +44,14 @@ struct appldata_os_per_cpu {
44 u32 per_cpu_system; /* ... spent in kernel mode */ 44 u32 per_cpu_system; /* ... spent in kernel mode */
45 u32 per_cpu_idle; /* ... spent in idle mode */ 45 u32 per_cpu_idle; /* ... spent in idle mode */
46 46
47// New in 2.6 --> 47 /* New in 2.6 */
48 u32 per_cpu_irq; /* ... spent in interrupts */ 48 u32 per_cpu_irq; /* ... spent in interrupts */
49 u32 per_cpu_softirq; /* ... spent in softirqs */ 49 u32 per_cpu_softirq; /* ... spent in softirqs */
50 u32 per_cpu_iowait; /* ... spent while waiting for I/O */ 50 u32 per_cpu_iowait; /* ... spent while waiting for I/O */
51// <-- New in 2.6 51
52 /* New in modification level 01 */
53 u32 per_cpu_steal; /* ... stolen by hypervisor */
54 u32 cpu_id; /* number of this CPU */
52} __attribute__((packed)); 55} __attribute__((packed));
53 56
54struct appldata_os_data { 57struct appldata_os_data {
@@ -68,10 +71,9 @@ struct appldata_os_data {
68 u32 avenrun[3]; /* average nr. of running processes during */ 71 u32 avenrun[3]; /* average nr. of running processes during */
69 /* the last 1, 5 and 15 minutes */ 72 /* the last 1, 5 and 15 minutes */
70 73
71// New in 2.6 --> 74 /* New in 2.6 */
72 u32 nr_iowait; /* number of blocked threads 75 u32 nr_iowait; /* number of blocked threads
73 (waiting for I/O) */ 76 (waiting for I/O) */
74// <-- New in 2.6
75 77
76 /* per cpu data */ 78 /* per cpu data */
77 struct appldata_os_per_cpu os_cpu[0]; 79 struct appldata_os_per_cpu os_cpu[0];
@@ -79,6 +81,14 @@ struct appldata_os_data {
79 81
80static struct appldata_os_data *appldata_os_data; 82static struct appldata_os_data *appldata_os_data;
81 83
84static struct appldata_ops ops = {
85 .ctl_nr = CTL_APPLDATA_OS,
86 .name = "os",
87 .record_nr = APPLDATA_RECORD_OS_ID,
88 .owner = THIS_MODULE,
89 .mod_lvl = {0xF0, 0xF1}, /* EBCDIC "01" */
90};
91
82 92
83static inline void appldata_print_debug(struct appldata_os_data *os_data) 93static inline void appldata_print_debug(struct appldata_os_data *os_data)
84{ 94{
@@ -100,15 +110,17 @@ static inline void appldata_print_debug(struct appldata_os_data *os_data)
100 P_DEBUG("nr_cpus = %u\n", os_data->nr_cpus); 110 P_DEBUG("nr_cpus = %u\n", os_data->nr_cpus);
101 for (i = 0; i < os_data->nr_cpus; i++) { 111 for (i = 0; i < os_data->nr_cpus; i++) {
102 P_DEBUG("cpu%u : user = %u, nice = %u, system = %u, " 112 P_DEBUG("cpu%u : user = %u, nice = %u, system = %u, "
103 "idle = %u, irq = %u, softirq = %u, iowait = %u\n", 113 "idle = %u, irq = %u, softirq = %u, iowait = %u, "
104 i, 114 "steal = %u\n",
115 os_data->os_cpu[i].cpu_id,
105 os_data->os_cpu[i].per_cpu_user, 116 os_data->os_cpu[i].per_cpu_user,
106 os_data->os_cpu[i].per_cpu_nice, 117 os_data->os_cpu[i].per_cpu_nice,
107 os_data->os_cpu[i].per_cpu_system, 118 os_data->os_cpu[i].per_cpu_system,
108 os_data->os_cpu[i].per_cpu_idle, 119 os_data->os_cpu[i].per_cpu_idle,
109 os_data->os_cpu[i].per_cpu_irq, 120 os_data->os_cpu[i].per_cpu_irq,
110 os_data->os_cpu[i].per_cpu_softirq, 121 os_data->os_cpu[i].per_cpu_softirq,
111 os_data->os_cpu[i].per_cpu_iowait); 122 os_data->os_cpu[i].per_cpu_iowait,
123 os_data->os_cpu[i].per_cpu_steal);
112 } 124 }
113 125
114 P_DEBUG("sync_count_1 = %u\n", os_data->sync_count_1); 126 P_DEBUG("sync_count_1 = %u\n", os_data->sync_count_1);
@@ -123,14 +135,13 @@ static inline void appldata_print_debug(struct appldata_os_data *os_data)
123 */ 135 */
124static void appldata_get_os_data(void *data) 136static void appldata_get_os_data(void *data)
125{ 137{
126 int i, j; 138 int i, j, rc;
127 struct appldata_os_data *os_data; 139 struct appldata_os_data *os_data;
140 unsigned int new_size;
128 141
129 os_data = data; 142 os_data = data;
130 os_data->sync_count_1++; 143 os_data->sync_count_1++;
131 144
132 os_data->nr_cpus = num_online_cpus();
133
134 os_data->nr_threads = nr_threads; 145 os_data->nr_threads = nr_threads;
135 os_data->nr_running = nr_running(); 146 os_data->nr_running = nr_running();
136 os_data->nr_iowait = nr_iowait(); 147 os_data->nr_iowait = nr_iowait();
@@ -154,9 +165,44 @@ static void appldata_get_os_data(void *data)
154 cputime_to_jiffies(kstat_cpu(i).cpustat.softirq); 165 cputime_to_jiffies(kstat_cpu(i).cpustat.softirq);
155 os_data->os_cpu[j].per_cpu_iowait = 166 os_data->os_cpu[j].per_cpu_iowait =
156 cputime_to_jiffies(kstat_cpu(i).cpustat.iowait); 167 cputime_to_jiffies(kstat_cpu(i).cpustat.iowait);
168 os_data->os_cpu[j].per_cpu_steal =
169 cputime_to_jiffies(kstat_cpu(i).cpustat.steal);
170 os_data->os_cpu[j].cpu_id = i;
157 j++; 171 j++;
158 } 172 }
159 173
174 os_data->nr_cpus = j;
175
176 new_size = sizeof(struct appldata_os_data) +
177 (os_data->nr_cpus * sizeof(struct appldata_os_per_cpu));
178 if (ops.size != new_size) {
179 if (ops.active) {
180 rc = appldata_diag(APPLDATA_RECORD_OS_ID,
181 APPLDATA_START_INTERVAL_REC,
182 (unsigned long) ops.data, new_size,
183 ops.mod_lvl);
184 if (rc != 0) {
185 P_ERROR("os: START NEW DIAG 0xDC failed, "
186 "return code: %d, new size = %i\n", rc,
187 new_size);
188 P_INFO("os: stopping old record now\n");
189 } else
190 P_INFO("os: new record size = %i\n", new_size);
191
192 rc = appldata_diag(APPLDATA_RECORD_OS_ID,
193 APPLDATA_STOP_REC,
194 (unsigned long) ops.data, ops.size,
195 ops.mod_lvl);
196 if (rc != 0)
197 P_ERROR("os: STOP OLD DIAG 0xDC failed, "
198 "return code: %d, old size = %i\n", rc,
199 ops.size);
200 else
201 P_INFO("os: old record size = %i stopped\n",
202 ops.size);
203 }
204 ops.size = new_size;
205 }
160 os_data->timestamp = get_clock(); 206 os_data->timestamp = get_clock();
161 os_data->sync_count_2++; 207 os_data->sync_count_2++;
162#ifdef APPLDATA_DEBUG 208#ifdef APPLDATA_DEBUG
@@ -165,15 +211,6 @@ static void appldata_get_os_data(void *data)
165} 211}
166 212
167 213
168static struct appldata_ops ops = {
169 .ctl_nr = CTL_APPLDATA_OS,
170 .name = "os",
171 .record_nr = APPLDATA_RECORD_OS_ID,
172 .callback = &appldata_get_os_data,
173 .owner = THIS_MODULE,
174};
175
176
177/* 214/*
178 * appldata_os_init() 215 * appldata_os_init()
179 * 216 *
@@ -181,26 +218,25 @@ static struct appldata_ops ops = {
181 */ 218 */
182static int __init appldata_os_init(void) 219static int __init appldata_os_init(void)
183{ 220{
184 int rc, size; 221 int rc, max_size;
185 222
186 size = sizeof(struct appldata_os_data) + 223 max_size = sizeof(struct appldata_os_data) +
187 (NR_CPUS * sizeof(struct appldata_os_per_cpu)); 224 (NR_CPUS * sizeof(struct appldata_os_per_cpu));
188 if (size > APPLDATA_MAX_REC_SIZE) { 225 if (max_size > APPLDATA_MAX_REC_SIZE) {
189 P_ERROR("Size of record = %i, bigger than maximum (%i)!\n", 226 P_ERROR("Max. size of OS record = %i, bigger than maximum "
190 size, APPLDATA_MAX_REC_SIZE); 227 "record size (%i)\n", max_size, APPLDATA_MAX_REC_SIZE);
191 rc = -ENOMEM; 228 rc = -ENOMEM;
192 goto out; 229 goto out;
193 } 230 }
194 P_DEBUG("sizeof(os) = %i, sizeof(os_cpu) = %lu\n", size, 231 P_DEBUG("max. sizeof(os) = %i, sizeof(os_cpu) = %lu\n", max_size,
195 sizeof(struct appldata_os_per_cpu)); 232 sizeof(struct appldata_os_per_cpu));
196 233
197 appldata_os_data = kmalloc(size, GFP_DMA); 234 appldata_os_data = kzalloc(max_size, GFP_DMA);
198 if (appldata_os_data == NULL) { 235 if (appldata_os_data == NULL) {
199 P_ERROR("No memory for %s!\n", ops.name); 236 P_ERROR("No memory for %s!\n", ops.name);
200 rc = -ENOMEM; 237 rc = -ENOMEM;
201 goto out; 238 goto out;
202 } 239 }
203 memset(appldata_os_data, 0, size);
204 240
205 appldata_os_data->per_cpu_size = sizeof(struct appldata_os_per_cpu); 241 appldata_os_data->per_cpu_size = sizeof(struct appldata_os_per_cpu);
206 appldata_os_data->cpu_offset = offsetof(struct appldata_os_data, 242 appldata_os_data->cpu_offset = offsetof(struct appldata_os_data,
@@ -208,7 +244,7 @@ static int __init appldata_os_init(void)
208 P_DEBUG("cpu offset = %u\n", appldata_os_data->cpu_offset); 244 P_DEBUG("cpu offset = %u\n", appldata_os_data->cpu_offset);
209 245
210 ops.data = appldata_os_data; 246 ops.data = appldata_os_data;
211 ops.size = size; 247 ops.callback = &appldata_get_os_data;
212 rc = appldata_register_ops(&ops); 248 rc = appldata_register_ops(&ops);
213 if (rc != 0) { 249 if (rc != 0) {
214 P_ERROR("Error registering ops, rc = %i\n", rc); 250 P_ERROR("Error registering ops, rc = %i\n", rc);
diff --git a/arch/s390/kernel/binfmt_elf32.c b/arch/s390/kernel/binfmt_elf32.c
index 1f451c2cb071..12a6311e9838 100644
--- a/arch/s390/kernel/binfmt_elf32.c
+++ b/arch/s390/kernel/binfmt_elf32.c
@@ -177,11 +177,6 @@ struct elf_prpsinfo32
177 177
178#include <linux/highuid.h> 178#include <linux/highuid.h>
179 179
180#undef NEW_TO_OLD_UID
181#undef NEW_TO_OLD_GID
182#define NEW_TO_OLD_UID(uid) ((uid) > 65535) ? (u16)overflowuid : (u16)(uid)
183#define NEW_TO_OLD_GID(gid) ((gid) > 65535) ? (u16)overflowgid : (u16)(gid)
184
185#define elf_addr_t u32 180#define elf_addr_t u32
186/* 181/*
187#define init_elf_binfmt init_elf32_binfmt 182#define init_elf_binfmt init_elf32_binfmt
diff --git a/arch/s390/kernel/entry.S b/arch/s390/kernel/entry.S
index b2448487854c..aa8b52c2140f 100644
--- a/arch/s390/kernel/entry.S
+++ b/arch/s390/kernel/entry.S
@@ -93,13 +93,22 @@ STACK_SIZE = 1 << STACK_SHIFT
93 l %r13,__LC_SVC_NEW_PSW+4 # load &system_call to %r13 93 l %r13,__LC_SVC_NEW_PSW+4 # load &system_call to %r13
94 .endm 94 .endm
95 95
96 .macro SAVE_ALL psworg,savearea,sync 96 .macro SAVE_ALL_SYNC psworg,savearea
97 la %r12,\psworg 97 la %r12,\psworg
98 .if \sync
99 tm \psworg+1,0x01 # test problem state bit 98 tm \psworg+1,0x01 # test problem state bit
100 bz BASED(2f) # skip stack setup save 99 bz BASED(2f) # skip stack setup save
101 l %r15,__LC_KERNEL_STACK # problem state -> load ksp 100 l %r15,__LC_KERNEL_STACK # problem state -> load ksp
102 .else 101#ifdef CONFIG_CHECK_STACK
102 b BASED(3f)
1032: tml %r15,STACK_SIZE - CONFIG_STACK_GUARD
104 bz BASED(stack_overflow)
1053:
106#endif
1072:
108 .endm
109
110 .macro SAVE_ALL_ASYNC psworg,savearea
111 la %r12,\psworg
103 tm \psworg+1,0x01 # test problem state bit 112 tm \psworg+1,0x01 # test problem state bit
104 bnz BASED(1f) # from user -> load async stack 113 bnz BASED(1f) # from user -> load async stack
105 clc \psworg+4(4),BASED(.Lcritical_end) 114 clc \psworg+4(4),BASED(.Lcritical_end)
@@ -115,7 +124,6 @@ STACK_SIZE = 1 << STACK_SHIFT
115 sra %r14,STACK_SHIFT 124 sra %r14,STACK_SHIFT
116 be BASED(2f) 125 be BASED(2f)
1171: l %r15,__LC_ASYNC_STACK 1261: l %r15,__LC_ASYNC_STACK
118 .endif
119#ifdef CONFIG_CHECK_STACK 127#ifdef CONFIG_CHECK_STACK
120 b BASED(3f) 128 b BASED(3f)
1212: tml %r15,STACK_SIZE - CONFIG_STACK_GUARD 1292: tml %r15,STACK_SIZE - CONFIG_STACK_GUARD
@@ -196,7 +204,7 @@ system_call:
196 STORE_TIMER __LC_SYNC_ENTER_TIMER 204 STORE_TIMER __LC_SYNC_ENTER_TIMER
197sysc_saveall: 205sysc_saveall:
198 SAVE_ALL_BASE __LC_SAVE_AREA 206 SAVE_ALL_BASE __LC_SAVE_AREA
199 SAVE_ALL __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1 207 SAVE_ALL_SYNC __LC_SVC_OLD_PSW,__LC_SAVE_AREA
200 CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA 208 CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA
201 lh %r7,0x8a # get svc number from lowcore 209 lh %r7,0x8a # get svc number from lowcore
202#ifdef CONFIG_VIRT_CPU_ACCOUNTING 210#ifdef CONFIG_VIRT_CPU_ACCOUNTING
@@ -425,7 +433,7 @@ pgm_check_handler:
425 SAVE_ALL_BASE __LC_SAVE_AREA 433 SAVE_ALL_BASE __LC_SAVE_AREA
426 tm __LC_PGM_INT_CODE+1,0x80 # check whether we got a per exception 434 tm __LC_PGM_INT_CODE+1,0x80 # check whether we got a per exception
427 bnz BASED(pgm_per) # got per exception -> special case 435 bnz BASED(pgm_per) # got per exception -> special case
428 SAVE_ALL __LC_PGM_OLD_PSW,__LC_SAVE_AREA,1 436 SAVE_ALL_SYNC __LC_PGM_OLD_PSW,__LC_SAVE_AREA
429 CREATE_STACK_FRAME __LC_PGM_OLD_PSW,__LC_SAVE_AREA 437 CREATE_STACK_FRAME __LC_PGM_OLD_PSW,__LC_SAVE_AREA
430#ifdef CONFIG_VIRT_CPU_ACCOUNTING 438#ifdef CONFIG_VIRT_CPU_ACCOUNTING
431 tm SP_PSW+1(%r15),0x01 # interrupting from user ? 439 tm SP_PSW+1(%r15),0x01 # interrupting from user ?
@@ -464,7 +472,7 @@ pgm_per:
464# Normal per exception 472# Normal per exception
465# 473#
466pgm_per_std: 474pgm_per_std:
467 SAVE_ALL __LC_PGM_OLD_PSW,__LC_SAVE_AREA,1 475 SAVE_ALL_SYNC __LC_PGM_OLD_PSW,__LC_SAVE_AREA
468 CREATE_STACK_FRAME __LC_PGM_OLD_PSW,__LC_SAVE_AREA 476 CREATE_STACK_FRAME __LC_PGM_OLD_PSW,__LC_SAVE_AREA
469#ifdef CONFIG_VIRT_CPU_ACCOUNTING 477#ifdef CONFIG_VIRT_CPU_ACCOUNTING
470 tm SP_PSW+1(%r15),0x01 # interrupting from user ? 478 tm SP_PSW+1(%r15),0x01 # interrupting from user ?
@@ -490,7 +498,7 @@ pgm_no_vtime2:
490# it was a single stepped SVC that is causing all the trouble 498# it was a single stepped SVC that is causing all the trouble
491# 499#
492pgm_svcper: 500pgm_svcper:
493 SAVE_ALL __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1 501 SAVE_ALL_SYNC __LC_SVC_OLD_PSW,__LC_SAVE_AREA
494 CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA 502 CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA
495#ifdef CONFIG_VIRT_CPU_ACCOUNTING 503#ifdef CONFIG_VIRT_CPU_ACCOUNTING
496 tm SP_PSW+1(%r15),0x01 # interrupting from user ? 504 tm SP_PSW+1(%r15),0x01 # interrupting from user ?
@@ -519,7 +527,7 @@ io_int_handler:
519 STORE_TIMER __LC_ASYNC_ENTER_TIMER 527 STORE_TIMER __LC_ASYNC_ENTER_TIMER
520 stck __LC_INT_CLOCK 528 stck __LC_INT_CLOCK
521 SAVE_ALL_BASE __LC_SAVE_AREA+16 529 SAVE_ALL_BASE __LC_SAVE_AREA+16
522 SAVE_ALL __LC_IO_OLD_PSW,__LC_SAVE_AREA+16,0 530 SAVE_ALL_ASYNC __LC_IO_OLD_PSW,__LC_SAVE_AREA+16
523 CREATE_STACK_FRAME __LC_IO_OLD_PSW,__LC_SAVE_AREA+16 531 CREATE_STACK_FRAME __LC_IO_OLD_PSW,__LC_SAVE_AREA+16
524#ifdef CONFIG_VIRT_CPU_ACCOUNTING 532#ifdef CONFIG_VIRT_CPU_ACCOUNTING
525 tm SP_PSW+1(%r15),0x01 # interrupting from user ? 533 tm SP_PSW+1(%r15),0x01 # interrupting from user ?
@@ -631,7 +639,7 @@ ext_int_handler:
631 STORE_TIMER __LC_ASYNC_ENTER_TIMER 639 STORE_TIMER __LC_ASYNC_ENTER_TIMER
632 stck __LC_INT_CLOCK 640 stck __LC_INT_CLOCK
633 SAVE_ALL_BASE __LC_SAVE_AREA+16 641 SAVE_ALL_BASE __LC_SAVE_AREA+16
634 SAVE_ALL __LC_EXT_OLD_PSW,__LC_SAVE_AREA+16,0 642 SAVE_ALL_ASYNC __LC_EXT_OLD_PSW,__LC_SAVE_AREA+16
635 CREATE_STACK_FRAME __LC_EXT_OLD_PSW,__LC_SAVE_AREA+16 643 CREATE_STACK_FRAME __LC_EXT_OLD_PSW,__LC_SAVE_AREA+16
636#ifdef CONFIG_VIRT_CPU_ACCOUNTING 644#ifdef CONFIG_VIRT_CPU_ACCOUNTING
637 tm SP_PSW+1(%r15),0x01 # interrupting from user ? 645 tm SP_PSW+1(%r15),0x01 # interrupting from user ?
@@ -657,21 +665,31 @@ __critical_end:
657 .globl mcck_int_handler 665 .globl mcck_int_handler
658mcck_int_handler: 666mcck_int_handler:
659 spt __LC_CPU_TIMER_SAVE_AREA # revalidate cpu timer 667 spt __LC_CPU_TIMER_SAVE_AREA # revalidate cpu timer
660 mvc __LC_ASYNC_ENTER_TIMER(8),__LC_CPU_TIMER_SAVE_AREA
661 lm %r0,%r15,__LC_GPREGS_SAVE_AREA # revalidate gprs 668 lm %r0,%r15,__LC_GPREGS_SAVE_AREA # revalidate gprs
662 SAVE_ALL_BASE __LC_SAVE_AREA+32 669 SAVE_ALL_BASE __LC_SAVE_AREA+32
663 la %r12,__LC_MCK_OLD_PSW 670 la %r12,__LC_MCK_OLD_PSW
664 tm __LC_MCCK_CODE,0x80 # system damage? 671 tm __LC_MCCK_CODE,0x80 # system damage?
665 bo BASED(mcck_int_main) # yes -> rest of mcck code invalid 672 bo BASED(mcck_int_main) # yes -> rest of mcck code invalid
666 tm __LC_MCCK_CODE+5,0x02 # stored cpu timer value valid?
667 bo BASED(0f)
668 spt __LC_LAST_UPDATE_TIMER # revalidate cpu timer
669#ifdef CONFIG_VIRT_CPU_ACCOUNTING 673#ifdef CONFIG_VIRT_CPU_ACCOUNTING
670 mvc __LC_ASYNC_ENTER_TIMER(8),__LC_LAST_UPDATE_TIMER 674 mvc __LC_SAVE_AREA+52(8),__LC_ASYNC_ENTER_TIMER
671 mvc __LC_SYNC_ENTER_TIMER(8),__LC_LAST_UPDATE_TIMER 675 mvc __LC_ASYNC_ENTER_TIMER(8),__LC_CPU_TIMER_SAVE_AREA
672 mvc __LC_EXIT_TIMER(8),__LC_LAST_UPDATE_TIMER 676 tm __LC_MCCK_CODE+5,0x02 # stored cpu timer value valid?
677 bo BASED(1f)
678 la %r14,__LC_SYNC_ENTER_TIMER
679 clc 0(8,%r14),__LC_ASYNC_ENTER_TIMER
680 bl BASED(0f)
681 la %r14,__LC_ASYNC_ENTER_TIMER
6820: clc 0(8,%r14),__LC_EXIT_TIMER
683 bl BASED(0f)
684 la %r14,__LC_EXIT_TIMER
6850: clc 0(8,%r14),__LC_LAST_UPDATE_TIMER
686 bl BASED(0f)
687 la %r14,__LC_LAST_UPDATE_TIMER
6880: spt 0(%r14)
689 mvc __LC_ASYNC_ENTER_TIMER(8),0(%r14)
6901:
673#endif 691#endif
6740: tm __LC_MCCK_CODE+2,0x09 # mwp + ia of old psw valid? 692 tm __LC_MCCK_CODE+2,0x09 # mwp + ia of old psw valid?
675 bno BASED(mcck_int_main) # no -> skip cleanup critical 693 bno BASED(mcck_int_main) # no -> skip cleanup critical
676 tm __LC_MCK_OLD_PSW+1,0x01 # test problem state bit 694 tm __LC_MCK_OLD_PSW+1,0x01 # test problem state bit
677 bnz BASED(mcck_int_main) # from user -> load async stack 695 bnz BASED(mcck_int_main) # from user -> load async stack
@@ -691,7 +709,7 @@ mcck_int_main:
691#ifdef CONFIG_VIRT_CPU_ACCOUNTING 709#ifdef CONFIG_VIRT_CPU_ACCOUNTING
692 tm __LC_MCCK_CODE+2,0x08 # mwp of old psw valid? 710 tm __LC_MCCK_CODE+2,0x08 # mwp of old psw valid?
693 bno BASED(mcck_no_vtime) # no -> skip cleanup critical 711 bno BASED(mcck_no_vtime) # no -> skip cleanup critical
694 tm __LC_MCK_OLD_PSW+1,0x01 # interrupting from user ? 712 tm SP_PSW+1(%r15),0x01 # interrupting from user ?
695 bz BASED(mcck_no_vtime) 713 bz BASED(mcck_no_vtime)
696 UPDATE_VTIME __LC_EXIT_TIMER,__LC_ASYNC_ENTER_TIMER,__LC_USER_TIMER 714 UPDATE_VTIME __LC_EXIT_TIMER,__LC_ASYNC_ENTER_TIMER,__LC_USER_TIMER
697 UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER 715 UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
@@ -715,6 +733,20 @@ mcck_no_vtime:
715 l %r1,BASED(.Ls390_handle_mcck) 733 l %r1,BASED(.Ls390_handle_mcck)
716 basr %r14,%r1 # call machine check handler 734 basr %r14,%r1 # call machine check handler
717mcck_return: 735mcck_return:
736 mvc __LC_RETURN_MCCK_PSW(8),SP_PSW(%r15) # move return PSW
737 ni __LC_RETURN_MCCK_PSW+1,0xfd # clear wait state bit
738#ifdef CONFIG_VIRT_CPU_ACCOUNTING
739 mvc __LC_ASYNC_ENTER_TIMER(8),__LC_SAVE_AREA+52
740 tm __LC_RETURN_MCCK_PSW+1,0x01 # returning to user ?
741 bno BASED(0f)
742 lm %r0,%r15,SP_R0(%r15) # load gprs 0-15
743 stpt __LC_EXIT_TIMER
744 lpsw __LC_RETURN_MCCK_PSW # back to caller
7450:
746#endif
747 lm %r0,%r15,SP_R0(%r15) # load gprs 0-15
748 lpsw __LC_RETURN_MCCK_PSW # back to caller
749
718 RESTORE_ALL __LC_RETURN_MCCK_PSW,0 750 RESTORE_ALL __LC_RETURN_MCCK_PSW,0
719 751
720#ifdef CONFIG_SMP 752#ifdef CONFIG_SMP
@@ -781,6 +813,8 @@ cleanup_table_sysc_leave:
781 .long sysc_leave + 0x80000000, sysc_work_loop + 0x80000000 813 .long sysc_leave + 0x80000000, sysc_work_loop + 0x80000000
782cleanup_table_sysc_work_loop: 814cleanup_table_sysc_work_loop:
783 .long sysc_work_loop + 0x80000000, sysc_reschedule + 0x80000000 815 .long sysc_work_loop + 0x80000000, sysc_reschedule + 0x80000000
816cleanup_table_io_return:
817 .long io_return + 0x80000000, io_leave + 0x80000000
784cleanup_table_io_leave: 818cleanup_table_io_leave:
785 .long io_leave + 0x80000000, io_done + 0x80000000 819 .long io_leave + 0x80000000, io_done + 0x80000000
786cleanup_table_io_work_loop: 820cleanup_table_io_work_loop:
@@ -807,6 +841,11 @@ cleanup_critical:
807 clc 4(4,%r12),BASED(cleanup_table_sysc_work_loop+4) 841 clc 4(4,%r12),BASED(cleanup_table_sysc_work_loop+4)
808 bl BASED(cleanup_sysc_return) 842 bl BASED(cleanup_sysc_return)
8090: 8430:
844 clc 4(4,%r12),BASED(cleanup_table_io_return)
845 bl BASED(0f)
846 clc 4(4,%r12),BASED(cleanup_table_io_return+4)
847 bl BASED(cleanup_io_return)
8480:
810 clc 4(4,%r12),BASED(cleanup_table_io_leave) 849 clc 4(4,%r12),BASED(cleanup_table_io_leave)
811 bl BASED(0f) 850 bl BASED(0f)
812 clc 4(4,%r12),BASED(cleanup_table_io_leave+4) 851 clc 4(4,%r12),BASED(cleanup_table_io_leave+4)
@@ -839,7 +878,7 @@ cleanup_system_call:
839 mvc __LC_SAVE_AREA(16),0(%r12) 878 mvc __LC_SAVE_AREA(16),0(%r12)
8400: st %r13,4(%r12) 8790: st %r13,4(%r12)
841 st %r12,__LC_SAVE_AREA+48 # argh 880 st %r12,__LC_SAVE_AREA+48 # argh
842 SAVE_ALL __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1 881 SAVE_ALL_SYNC __LC_SVC_OLD_PSW,__LC_SAVE_AREA
843 CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA 882 CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA
844 l %r12,__LC_SAVE_AREA+48 # argh 883 l %r12,__LC_SAVE_AREA+48 # argh
845 st %r15,12(%r12) 884 st %r15,12(%r12)
@@ -980,7 +1019,6 @@ cleanup_io_leave_insn:
980 .long cleanup_critical 1019 .long cleanup_critical
981 1020
982#define SYSCALL(esa,esame,emu) .long esa 1021#define SYSCALL(esa,esame,emu) .long esa
983 .globl sys_call_table
984sys_call_table: 1022sys_call_table:
985#include "syscalls.S" 1023#include "syscalls.S"
986#undef SYSCALL 1024#undef SYSCALL
diff --git a/arch/s390/kernel/entry64.S b/arch/s390/kernel/entry64.S
index 2ac095bc0e25..f3222a1b2861 100644
--- a/arch/s390/kernel/entry64.S
+++ b/arch/s390/kernel/entry64.S
@@ -87,13 +87,22 @@ _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK | _TIF_NEED_RESCHED | \
87 larl %r13,system_call 87 larl %r13,system_call
88 .endm 88 .endm
89 89
90 .macro SAVE_ALL psworg,savearea,sync 90 .macro SAVE_ALL_SYNC psworg,savearea
91 la %r12,\psworg 91 la %r12,\psworg
92 .if \sync
93 tm \psworg+1,0x01 # test problem state bit 92 tm \psworg+1,0x01 # test problem state bit
94 jz 2f # skip stack setup save 93 jz 2f # skip stack setup save
95 lg %r15,__LC_KERNEL_STACK # problem state -> load ksp 94 lg %r15,__LC_KERNEL_STACK # problem state -> load ksp
96 .else 95#ifdef CONFIG_CHECK_STACK
96 j 3f
972: tml %r15,STACK_SIZE - CONFIG_STACK_GUARD
98 jz stack_overflow
993:
100#endif
1012:
102 .endm
103
104 .macro SAVE_ALL_ASYNC psworg,savearea
105 la %r12,\psworg
97 tm \psworg+1,0x01 # test problem state bit 106 tm \psworg+1,0x01 # test problem state bit
98 jnz 1f # from user -> load kernel stack 107 jnz 1f # from user -> load kernel stack
99 clc \psworg+8(8),BASED(.Lcritical_end) 108 clc \psworg+8(8),BASED(.Lcritical_end)
@@ -108,7 +117,6 @@ _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK | _TIF_NEED_RESCHED | \
108 srag %r14,%r14,STACK_SHIFT 117 srag %r14,%r14,STACK_SHIFT
109 jz 2f 118 jz 2f
1101: lg %r15,__LC_ASYNC_STACK # load async stack 1191: lg %r15,__LC_ASYNC_STACK # load async stack
111 .endif
112#ifdef CONFIG_CHECK_STACK 120#ifdef CONFIG_CHECK_STACK
113 j 3f 121 j 3f
1142: tml %r15,STACK_SIZE - CONFIG_STACK_GUARD 1222: tml %r15,STACK_SIZE - CONFIG_STACK_GUARD
@@ -187,7 +195,7 @@ system_call:
187 STORE_TIMER __LC_SYNC_ENTER_TIMER 195 STORE_TIMER __LC_SYNC_ENTER_TIMER
188sysc_saveall: 196sysc_saveall:
189 SAVE_ALL_BASE __LC_SAVE_AREA 197 SAVE_ALL_BASE __LC_SAVE_AREA
190 SAVE_ALL __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1 198 SAVE_ALL_SYNC __LC_SVC_OLD_PSW,__LC_SAVE_AREA
191 CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA 199 CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA
192 llgh %r7,__LC_SVC_INT_CODE # get svc number from lowcore 200 llgh %r7,__LC_SVC_INT_CODE # get svc number from lowcore
193#ifdef CONFIG_VIRT_CPU_ACCOUNTING 201#ifdef CONFIG_VIRT_CPU_ACCOUNTING
@@ -446,7 +454,7 @@ pgm_check_handler:
446 SAVE_ALL_BASE __LC_SAVE_AREA 454 SAVE_ALL_BASE __LC_SAVE_AREA
447 tm __LC_PGM_INT_CODE+1,0x80 # check whether we got a per exception 455 tm __LC_PGM_INT_CODE+1,0x80 # check whether we got a per exception
448 jnz pgm_per # got per exception -> special case 456 jnz pgm_per # got per exception -> special case
449 SAVE_ALL __LC_PGM_OLD_PSW,__LC_SAVE_AREA,1 457 SAVE_ALL_SYNC __LC_PGM_OLD_PSW,__LC_SAVE_AREA
450 CREATE_STACK_FRAME __LC_PGM_OLD_PSW,__LC_SAVE_AREA 458 CREATE_STACK_FRAME __LC_PGM_OLD_PSW,__LC_SAVE_AREA
451#ifdef CONFIG_VIRT_CPU_ACCOUNTING 459#ifdef CONFIG_VIRT_CPU_ACCOUNTING
452 tm SP_PSW+1(%r15),0x01 # interrupting from user ? 460 tm SP_PSW+1(%r15),0x01 # interrupting from user ?
@@ -485,7 +493,7 @@ pgm_per:
485# Normal per exception 493# Normal per exception
486# 494#
487pgm_per_std: 495pgm_per_std:
488 SAVE_ALL __LC_PGM_OLD_PSW,__LC_SAVE_AREA,1 496 SAVE_ALL_SYNC __LC_PGM_OLD_PSW,__LC_SAVE_AREA
489 CREATE_STACK_FRAME __LC_PGM_OLD_PSW,__LC_SAVE_AREA 497 CREATE_STACK_FRAME __LC_PGM_OLD_PSW,__LC_SAVE_AREA
490#ifdef CONFIG_VIRT_CPU_ACCOUNTING 498#ifdef CONFIG_VIRT_CPU_ACCOUNTING
491 tm SP_PSW+1(%r15),0x01 # interrupting from user ? 499 tm SP_PSW+1(%r15),0x01 # interrupting from user ?
@@ -511,7 +519,7 @@ pgm_no_vtime2:
511# it was a single stepped SVC that is causing all the trouble 519# it was a single stepped SVC that is causing all the trouble
512# 520#
513pgm_svcper: 521pgm_svcper:
514 SAVE_ALL __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1 522 SAVE_ALL_SYNC __LC_SVC_OLD_PSW,__LC_SAVE_AREA
515 CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA 523 CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA
516#ifdef CONFIG_VIRT_CPU_ACCOUNTING 524#ifdef CONFIG_VIRT_CPU_ACCOUNTING
517 tm SP_PSW+1(%r15),0x01 # interrupting from user ? 525 tm SP_PSW+1(%r15),0x01 # interrupting from user ?
@@ -539,7 +547,7 @@ io_int_handler:
539 STORE_TIMER __LC_ASYNC_ENTER_TIMER 547 STORE_TIMER __LC_ASYNC_ENTER_TIMER
540 stck __LC_INT_CLOCK 548 stck __LC_INT_CLOCK
541 SAVE_ALL_BASE __LC_SAVE_AREA+32 549 SAVE_ALL_BASE __LC_SAVE_AREA+32
542 SAVE_ALL __LC_IO_OLD_PSW,__LC_SAVE_AREA+32,0 550 SAVE_ALL_ASYNC __LC_IO_OLD_PSW,__LC_SAVE_AREA+32
543 CREATE_STACK_FRAME __LC_IO_OLD_PSW,__LC_SAVE_AREA+32 551 CREATE_STACK_FRAME __LC_IO_OLD_PSW,__LC_SAVE_AREA+32
544#ifdef CONFIG_VIRT_CPU_ACCOUNTING 552#ifdef CONFIG_VIRT_CPU_ACCOUNTING
545 tm SP_PSW+1(%r15),0x01 # interrupting from user ? 553 tm SP_PSW+1(%r15),0x01 # interrupting from user ?
@@ -647,7 +655,7 @@ ext_int_handler:
647 STORE_TIMER __LC_ASYNC_ENTER_TIMER 655 STORE_TIMER __LC_ASYNC_ENTER_TIMER
648 stck __LC_INT_CLOCK 656 stck __LC_INT_CLOCK
649 SAVE_ALL_BASE __LC_SAVE_AREA+32 657 SAVE_ALL_BASE __LC_SAVE_AREA+32
650 SAVE_ALL __LC_EXT_OLD_PSW,__LC_SAVE_AREA+32,0 658 SAVE_ALL_ASYNC __LC_EXT_OLD_PSW,__LC_SAVE_AREA+32
651 CREATE_STACK_FRAME __LC_EXT_OLD_PSW,__LC_SAVE_AREA+32 659 CREATE_STACK_FRAME __LC_EXT_OLD_PSW,__LC_SAVE_AREA+32
652#ifdef CONFIG_VIRT_CPU_ACCOUNTING 660#ifdef CONFIG_VIRT_CPU_ACCOUNTING
653 tm SP_PSW+1(%r15),0x01 # interrupting from user ? 661 tm SP_PSW+1(%r15),0x01 # interrupting from user ?
@@ -672,21 +680,32 @@ __critical_end:
672mcck_int_handler: 680mcck_int_handler:
673 la %r1,4095 # revalidate r1 681 la %r1,4095 # revalidate r1
674 spt __LC_CPU_TIMER_SAVE_AREA-4095(%r1) # revalidate cpu timer 682 spt __LC_CPU_TIMER_SAVE_AREA-4095(%r1) # revalidate cpu timer
675 mvc __LC_ASYNC_ENTER_TIMER(8),__LC_CPU_TIMER_SAVE_AREA-4095(%r1)
676 lmg %r0,%r15,__LC_GPREGS_SAVE_AREA-4095(%r1)# revalidate gprs 683 lmg %r0,%r15,__LC_GPREGS_SAVE_AREA-4095(%r1)# revalidate gprs
677 SAVE_ALL_BASE __LC_SAVE_AREA+64 684 SAVE_ALL_BASE __LC_SAVE_AREA+64
678 la %r12,__LC_MCK_OLD_PSW 685 la %r12,__LC_MCK_OLD_PSW
679 tm __LC_MCCK_CODE,0x80 # system damage? 686 tm __LC_MCCK_CODE,0x80 # system damage?
680 jo mcck_int_main # yes -> rest of mcck code invalid 687 jo mcck_int_main # yes -> rest of mcck code invalid
681 tm __LC_MCCK_CODE+5,0x02 # stored cpu timer value valid?
682 jo 0f
683 spt __LC_LAST_UPDATE_TIMER
684#ifdef CONFIG_VIRT_CPU_ACCOUNTING 688#ifdef CONFIG_VIRT_CPU_ACCOUNTING
685 mvc __LC_ASYNC_ENTER_TIMER(8),__LC_LAST_UPDATE_TIMER 689 la %r14,4095
686 mvc __LC_SYNC_ENTER_TIMER(8),__LC_LAST_UPDATE_TIMER 690 mvc __LC_SAVE_AREA+104(8),__LC_ASYNC_ENTER_TIMER
687 mvc __LC_EXIT_TIMER(8),__LC_LAST_UPDATE_TIMER 691 mvc __LC_ASYNC_ENTER_TIMER(8),__LC_CPU_TIMER_SAVE_AREA-4095(%r14)
692 tm __LC_MCCK_CODE+5,0x02 # stored cpu timer value valid?
693 jo 1f
694 la %r14,__LC_SYNC_ENTER_TIMER
695 clc 0(8,%r14),__LC_ASYNC_ENTER_TIMER
696 jl 0f
697 la %r14,__LC_ASYNC_ENTER_TIMER
6980: clc 0(8,%r14),__LC_EXIT_TIMER
699 jl 0f
700 la %r14,__LC_EXIT_TIMER
7010: clc 0(8,%r14),__LC_LAST_UPDATE_TIMER
702 jl 0f
703 la %r14,__LC_LAST_UPDATE_TIMER
7040: spt 0(%r14)
705 mvc __LC_ASYNC_ENTER_TIMER(8),0(%r14)
7061:
688#endif 707#endif
6890: tm __LC_MCCK_CODE+2,0x09 # mwp + ia of old psw valid? 708 tm __LC_MCCK_CODE+2,0x09 # mwp + ia of old psw valid?
690 jno mcck_int_main # no -> skip cleanup critical 709 jno mcck_int_main # no -> skip cleanup critical
691 tm __LC_MCK_OLD_PSW+1,0x01 # test problem state bit 710 tm __LC_MCK_OLD_PSW+1,0x01 # test problem state bit
692 jnz mcck_int_main # from user -> load kernel stack 711 jnz mcck_int_main # from user -> load kernel stack
@@ -705,7 +724,7 @@ mcck_int_main:
705#ifdef CONFIG_VIRT_CPU_ACCOUNTING 724#ifdef CONFIG_VIRT_CPU_ACCOUNTING
706 tm __LC_MCCK_CODE+2,0x08 # mwp of old psw valid? 725 tm __LC_MCCK_CODE+2,0x08 # mwp of old psw valid?
707 jno mcck_no_vtime # no -> no timer update 726 jno mcck_no_vtime # no -> no timer update
708 tm __LC_MCK_OLD_PSW+1,0x01 # interrupting from user ? 727 tm SP_PSW+1(%r15),0x01 # interrupting from user ?
709 jz mcck_no_vtime 728 jz mcck_no_vtime
710 UPDATE_VTIME __LC_EXIT_TIMER,__LC_ASYNC_ENTER_TIMER,__LC_USER_TIMER 729 UPDATE_VTIME __LC_EXIT_TIMER,__LC_ASYNC_ENTER_TIMER,__LC_USER_TIMER
711 UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER 730 UPDATE_VTIME __LC_LAST_UPDATE_TIMER,__LC_EXIT_TIMER,__LC_SYSTEM_TIMER
@@ -727,7 +746,17 @@ mcck_no_vtime:
727 jno mcck_return 746 jno mcck_return
728 brasl %r14,s390_handle_mcck 747 brasl %r14,s390_handle_mcck
729mcck_return: 748mcck_return:
730 RESTORE_ALL __LC_RETURN_MCCK_PSW,0 749 mvc __LC_RETURN_MCCK_PSW(16),SP_PSW(%r15) # move return PSW
750 ni __LC_RETURN_MCCK_PSW+1,0xfd # clear wait state bit
751 lmg %r0,%r15,SP_R0(%r15) # load gprs 0-15
752#ifdef CONFIG_VIRT_CPU_ACCOUNTING
753 mvc __LC_ASYNC_ENTER_TIMER(8),__LC_SAVE_AREA+104
754 tm __LC_RETURN_MCCK_PSW+1,0x01 # returning to user ?
755 jno 0f
756 stpt __LC_EXIT_TIMER
7570:
758#endif
759 lpswe __LC_RETURN_MCCK_PSW # back to caller
731 760
732#ifdef CONFIG_SMP 761#ifdef CONFIG_SMP
733/* 762/*
@@ -789,6 +818,8 @@ cleanup_table_sysc_leave:
789 .quad sysc_leave, sysc_work_loop 818 .quad sysc_leave, sysc_work_loop
790cleanup_table_sysc_work_loop: 819cleanup_table_sysc_work_loop:
791 .quad sysc_work_loop, sysc_reschedule 820 .quad sysc_work_loop, sysc_reschedule
821cleanup_table_io_return:
822 .quad io_return, io_leave
792cleanup_table_io_leave: 823cleanup_table_io_leave:
793 .quad io_leave, io_done 824 .quad io_leave, io_done
794cleanup_table_io_work_loop: 825cleanup_table_io_work_loop:
@@ -815,6 +846,11 @@ cleanup_critical:
815 clc 8(8,%r12),BASED(cleanup_table_sysc_work_loop+8) 846 clc 8(8,%r12),BASED(cleanup_table_sysc_work_loop+8)
816 jl cleanup_sysc_return 847 jl cleanup_sysc_return
8170: 8480:
849 clc 8(8,%r12),BASED(cleanup_table_io_return)
850 jl 0f
851 clc 8(8,%r12),BASED(cleanup_table_io_return+8)
852 jl cleanup_io_return
8530:
818 clc 8(8,%r12),BASED(cleanup_table_io_leave) 854 clc 8(8,%r12),BASED(cleanup_table_io_leave)
819 jl 0f 855 jl 0f
820 clc 8(8,%r12),BASED(cleanup_table_io_leave+8) 856 clc 8(8,%r12),BASED(cleanup_table_io_leave+8)
@@ -847,7 +883,7 @@ cleanup_system_call:
847 mvc __LC_SAVE_AREA(32),0(%r12) 883 mvc __LC_SAVE_AREA(32),0(%r12)
8480: stg %r13,8(%r12) 8840: stg %r13,8(%r12)
849 stg %r12,__LC_SAVE_AREA+96 # argh 885 stg %r12,__LC_SAVE_AREA+96 # argh
850 SAVE_ALL __LC_SVC_OLD_PSW,__LC_SAVE_AREA,1 886 SAVE_ALL_SYNC __LC_SVC_OLD_PSW,__LC_SAVE_AREA
851 CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA 887 CREATE_STACK_FRAME __LC_SVC_OLD_PSW,__LC_SAVE_AREA
852 lg %r12,__LC_SAVE_AREA+96 # argh 888 lg %r12,__LC_SAVE_AREA+96 # argh
853 stg %r15,24(%r12) 889 stg %r15,24(%r12)
@@ -957,7 +993,6 @@ cleanup_io_leave_insn:
957 .quad __critical_end 993 .quad __critical_end
958 994
959#define SYSCALL(esa,esame,emu) .long esame 995#define SYSCALL(esa,esame,emu) .long esame
960 .globl sys_call_table
961sys_call_table: 996sys_call_table:
962#include "syscalls.S" 997#include "syscalls.S"
963#undef SYSCALL 998#undef SYSCALL
@@ -965,7 +1000,6 @@ sys_call_table:
965#ifdef CONFIG_COMPAT 1000#ifdef CONFIG_COMPAT
966 1001
967#define SYSCALL(esa,esame,emu) .long emu 1002#define SYSCALL(esa,esame,emu) .long emu
968 .globl sys_call_table_emu
969sys_call_table_emu: 1003sys_call_table_emu:
970#include "syscalls.S" 1004#include "syscalls.S"
971#undef SYSCALL 1005#undef SYSCALL
diff --git a/arch/s390/kernel/head.S b/arch/s390/kernel/head.S
index ea88d066bf04..538c82da49b1 100644
--- a/arch/s390/kernel/head.S
+++ b/arch/s390/kernel/head.S
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/s390/kernel/head.S 2 * arch/s390/kernel/head.S
3 * 3 *
4 * (C) Copyright IBM Corp. 1999, 2005 4 * Copyright (C) IBM Corp. 1999,2006
5 * 5 *
6 * Author(s): Hartmut Penner <hp@de.ibm.com> 6 * Author(s): Hartmut Penner <hp@de.ibm.com>
7 * Martin Schwidefsky <schwidefsky@de.ibm.com> 7 * Martin Schwidefsky <schwidefsky@de.ibm.com>
@@ -482,24 +482,23 @@ start:
482 482
483.macro GET_IPL_DEVICE 483.macro GET_IPL_DEVICE
484.Lget_ipl_device: 484.Lget_ipl_device:
485 basr %r12,0 485 l %r1,0xb8 # get sid
486.LGID: l %r1,0xb8 # get sid
487 sll %r1,15 # test if subchannel is enabled 486 sll %r1,15 # test if subchannel is enabled
488 srl %r1,31 487 srl %r1,31
489 ltr %r1,%r1 488 ltr %r1,%r1
490 bz 0(%r14) # subchannel disabled 489 bz 2f-.LPG1(%r13) # subchannel disabled
491 l %r1,0xb8 490 l %r1,0xb8
492 la %r5,.Lipl_schib-.LGID(%r12) 491 la %r5,.Lipl_schib-.LPG1(%r13)
493 stsch 0(%r5) # get schib of subchannel 492 stsch 0(%r5) # get schib of subchannel
494 bnz 0(%r14) # schib not available 493 bnz 2f-.LPG1(%r13) # schib not available
495 tm 5(%r5),0x01 # devno valid? 494 tm 5(%r5),0x01 # devno valid?
496 bno 0(%r14) 495 bno 2f-.LPG1(%r13)
497 la %r6,ipl_parameter_flags-.LGID(%r12) 496 la %r6,ipl_parameter_flags-.LPG1(%r13)
498 oi 3(%r6),0x01 # set flag 497 oi 3(%r6),0x01 # set flag
499 la %r2,ipl_devno-.LGID(%r12) 498 la %r2,ipl_devno-.LPG1(%r13)
500 mvc 0(2,%r2),6(%r5) # store devno 499 mvc 0(2,%r2),6(%r5) # store devno
501 tm 4(%r5),0x80 # qdio capable device? 500 tm 4(%r5),0x80 # qdio capable device?
502 bno 0(%r14) 501 bno 2f-.LPG1(%r13)
503 oi 3(%r6),0x02 # set flag 502 oi 3(%r6),0x02 # set flag
504 503
505 # copy ipl parameters 504 # copy ipl parameters
@@ -523,7 +522,7 @@ start:
523 ar %r2,%r1 522 ar %r2,%r1
524 sr %r0,%r4 523 sr %r0,%r4
525 jne 1b 524 jne 1b
526 b 0(%r14) 525 b 2f-.LPG1(%r13)
527 526
528 .align 4 527 .align 4
529.Lipl_schib: 528.Lipl_schib:
@@ -537,6 +536,7 @@ ipl_parameter_flags:
537 .globl ipl_devno 536 .globl ipl_devno
538ipl_devno: 537ipl_devno:
539 .word 0 538 .word 0
5392:
540.endm 540.endm
541 541
542#ifdef CONFIG_64BIT 542#ifdef CONFIG_64BIT
diff --git a/arch/s390/kernel/head31.S b/arch/s390/kernel/head31.S
index 2d3b089bfb83..d00de17b3778 100644
--- a/arch/s390/kernel/head31.S
+++ b/arch/s390/kernel/head31.S
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/s390/kernel/head31.S 2 * arch/s390/kernel/head31.S
3 * 3 *
4 * (C) Copyright IBM Corp. 2005 4 * Copyright (C) IBM Corp. 2005,2006
5 * 5 *
6 * Author(s): Hartmut Penner <hp@de.ibm.com> 6 * Author(s): Hartmut Penner <hp@de.ibm.com>
7 * Martin Schwidefsky <schwidefsky@de.ibm.com> 7 * Martin Schwidefsky <schwidefsky@de.ibm.com>
@@ -16,12 +16,31 @@
16# or linload or SALIPL 16# or linload or SALIPL
17# 17#
18 .org 0x10000 18 .org 0x10000
19startup:basr %r13,0 # get base 19startup:basr %r13,0 # get base
20.LPG1: l %r1, .Lget_ipl_device_addr-.LPG1(%r13) 20.LPG0: l %r13,0f-.LPG0(%r13)
21 basr %r14, %r1 21 b 0(%r13)
220: .long startup_continue
23
24#
25# params at 10400 (setup.h)
26#
27 .org PARMAREA
28 .long 0,0 # IPL_DEVICE
29 .long 0,RAMDISK_ORIGIN # INITRD_START
30 .long 0,RAMDISK_SIZE # INITRD_SIZE
31
32 .org COMMAND_LINE
33 .byte "root=/dev/ram0 ro"
34 .byte 0
35
36 .org 0x11000
37
38startup_continue:
39 basr %r13,0 # get base
40.LPG1: GET_IPL_DEVICE
22 lctl %c0,%c15,.Lctl-.LPG1(%r13) # load control registers 41 lctl %c0,%c15,.Lctl-.LPG1(%r13) # load control registers
23 la %r12,_pstart-.LPG1(%r13) # pointer to parameter area 42 l %r12,.Lparmaddr-.LPG1(%r13) # pointer to parameter area
24 # move IPL device to lowcore 43 # move IPL device to lowcore
25 mvc __LC_IPLDEV(4),IPL_DEVICE-PARMAREA(%r12) 44 mvc __LC_IPLDEV(4),IPL_DEVICE-PARMAREA(%r12)
26 45
27# 46#
@@ -51,8 +70,8 @@ startup:basr %r13,0 # get base
51 a %r1,__LC_EXT_NEW_PSW+4 # set handler 70 a %r1,__LC_EXT_NEW_PSW+4 # set handler
52 st %r1,__LC_EXT_NEW_PSW+4 71 st %r1,__LC_EXT_NEW_PSW+4
53 72
54 la %r4,_pstart-.LPG1(%r13) # %r4 is our index for sccb stuff 73 l %r4,.Lsccbaddr-.LPG1(%r13) # %r4 is our index for sccb stuff
55 la %r1, .Lsccb-PARMAREA(%r4) # our sccb 74 lr %r1,%r4 # our sccb
56 .insn rre,0xb2200000,%r2,%r1 # service call 75 .insn rre,0xb2200000,%r2,%r1 # service call
57 ipm %r1 76 ipm %r1
58 srl %r1,28 # get cc code 77 srl %r1,28 # get cc code
@@ -63,7 +82,7 @@ startup:basr %r13,0 # get base
63 be .Lservicecall-.LPG1(%r13) 82 be .Lservicecall-.LPG1(%r13)
64 lpsw .Lwaitsclp-.LPG1(%r13) 83 lpsw .Lwaitsclp-.LPG1(%r13)
65.Lsclph: 84.Lsclph:
66 lh %r1,.Lsccbr-PARMAREA(%r4) 85 lh %r1,.Lsccbr-.Lsccb(%r4)
67 chi %r1,0x10 # 0x0010 is the sucess code 86 chi %r1,0x10 # 0x0010 is the sucess code
68 je .Lprocsccb # let's process the sccb 87 je .Lprocsccb # let's process the sccb
69 chi %r1,0x1f0 88 chi %r1,0x1f0
@@ -74,7 +93,7 @@ startup:basr %r13,0 # get base
74 b .Lservicecall-.LPG1(%r13) 93 b .Lservicecall-.LPG1(%r13)
75.Lprocsccb: 94.Lprocsccb:
76 lhi %r1,0 95 lhi %r1,0
77 icm %r1,3,.Lscpincr1-PARMAREA(%r4) # use this one if != 0 96 icm %r1,3,.Lscpincr1-.Lsccb(%r4) # use this one if != 0
78 jnz .Lscnd 97 jnz .Lscnd
79 lhi %r1,0x800 # otherwise report 2GB 98 lhi %r1,0x800 # otherwise report 2GB
80.Lscnd: 99.Lscnd:
@@ -84,10 +103,10 @@ startup:basr %r13,0 # get base
84 lr %r1,%r3 103 lr %r1,%r3
85.Lno2gb: 104.Lno2gb:
86 xr %r3,%r3 # same logic 105 xr %r3,%r3 # same logic
87 ic %r3,.Lscpa1-PARMAREA(%r4) 106 ic %r3,.Lscpa1-.Lsccb(%r4)
88 chi %r3,0x00 107 chi %r3,0x00
89 jne .Lcompmem 108 jne .Lcompmem
90 l %r3,.Lscpa2-PARMAREA(%r13) 109 l %r3,.Lscpa2-.Lsccb(%r4)
91.Lcompmem: 110.Lcompmem:
92 mr %r2,%r1 # mem in MB on 128-bit 111 mr %r2,%r1 # mem in MB on 128-bit
93 l %r1,.Lonemb-.LPG1(%r13) 112 l %r1,.Lonemb-.LPG1(%r13)
@@ -95,8 +114,6 @@ startup:basr %r13,0 # get base
95 b .Lfchunk-.LPG1(%r13) 114 b .Lfchunk-.LPG1(%r13)
96 115
97 .align 4 116 .align 4
98.Lget_ipl_device_addr:
99 .long .Lget_ipl_device
100.Lpmask: 117.Lpmask:
101 .byte 0 118 .byte 0
102.align 8 119.align 8
@@ -242,6 +259,8 @@ startup:basr %r13,0 # get base
242 .long 0 # cr13: home space segment table 259 .long 0 # cr13: home space segment table
243 .long 0xc0000000 # cr14: machine check handling off 260 .long 0xc0000000 # cr14: machine check handling off
244 .long 0 # cr15: linkage stack operations 261 .long 0 # cr15: linkage stack operations
262.Lduct: .long 0,0,0,0,0,0,0,0
263 .long 0,0,0,0,0,0,0,0
245.Lpcmem:.long 0x00080000,0x80000000 + .Lchkmem 264.Lpcmem:.long 0x00080000,0x80000000 + .Lchkmem
246.Lpcfpu:.long 0x00080000,0x80000000 + .Lchkfpu 265.Lpcfpu:.long 0x00080000,0x80000000 + .Lchkfpu
247.Lpccsp:.long 0x00080000,0x80000000 + .Lchkcsp 266.Lpccsp:.long 0x00080000,0x80000000 + .Lchkcsp
@@ -252,25 +271,9 @@ startup:basr %r13,0 # get base
252.Lmflags:.long machine_flags 271.Lmflags:.long machine_flags
253.Lbss_bgn: .long __bss_start 272.Lbss_bgn: .long __bss_start
254.Lbss_end: .long _end 273.Lbss_end: .long _end
255 274.Lparmaddr: .long PARMAREA
256 .org PARMAREA-64 275.Lsccbaddr: .long .Lsccb
257.Lduct: .long 0,0,0,0,0,0,0,0 276 .align 4096
258 .long 0,0,0,0,0,0,0,0
259
260#
261# params at 10400 (setup.h)
262#
263 .org PARMAREA
264 .global _pstart
265_pstart:
266 .long 0,0 # IPL_DEVICE
267 .long 0,RAMDISK_ORIGIN # INITRD_START
268 .long 0,RAMDISK_SIZE # INITRD_SIZE
269
270 .org COMMAND_LINE
271 .byte "root=/dev/ram0 ro"
272 .byte 0
273 .org 0x11000
274.Lsccb: 277.Lsccb:
275 .hword 0x1000 # length, one page 278 .hword 0x1000 # length, one page
276 .byte 0x00,0x00,0x00 279 .byte 0x00,0x00,0x00
@@ -287,18 +290,14 @@ _pstart:
287.Lscpincr2: 290.Lscpincr2:
288 .quad 0x00 291 .quad 0x00
289 .fill 3984,1,0 292 .fill 3984,1,0
290 .org 0x12000 293 .align 4096
291 .global _pend
292_pend:
293
294 GET_IPL_DEVICE
295 294
296#ifdef CONFIG_SHARED_KERNEL 295#ifdef CONFIG_SHARED_KERNEL
297 .org 0x100000 296 .org 0x100000
298#endif 297#endif
299 298
300# 299#
301# startup-code, running in virtual mode 300# startup-code, running in absolute addressing mode
302# 301#
303 .globl _stext 302 .globl _stext
304_stext: basr %r13,0 # get base 303_stext: basr %r13,0 # get base
diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S
index f08c06f45d5c..47744fcca930 100644
--- a/arch/s390/kernel/head64.S
+++ b/arch/s390/kernel/head64.S
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/s390/kernel/head64.S 2 * arch/s390/kernel/head64.S
3 * 3 *
4 * (C) Copyright IBM Corp. 1999,2005 4 * Copyright (C) IBM Corp. 1999,2006
5 * 5 *
6 * Author(s): Hartmut Penner <hp@de.ibm.com> 6 * Author(s): Hartmut Penner <hp@de.ibm.com>
7 * Martin Schwidefsky <schwidefsky@de.ibm.com> 7 * Martin Schwidefsky <schwidefsky@de.ibm.com>
@@ -15,18 +15,37 @@
15# this is called either by the ipl loader or directly by PSW restart 15# this is called either by the ipl loader or directly by PSW restart
16# or linload or SALIPL 16# or linload or SALIPL
17# 17#
18 .org 0x10000 18 .org 0x10000
19startup:basr %r13,0 # get base 19startup:basr %r13,0 # get base
20.LPG0: l %r13,0f-.LPG0(%r13)
21 b 0(%r13)
220: .long startup_continue
23
24#
25# params at 10400 (setup.h)
26#
27 .org PARMAREA
28 .quad 0 # IPL_DEVICE
29 .quad RAMDISK_ORIGIN # INITRD_START
30 .quad RAMDISK_SIZE # INITRD_SIZE
31
32 .org COMMAND_LINE
33 .byte "root=/dev/ram0 ro"
34 .byte 0
35
36 .org 0x11000
37
38startup_continue:
39 basr %r13,0 # get base
20.LPG1: sll %r13,1 # remove high order bit 40.LPG1: sll %r13,1 # remove high order bit
21 srl %r13,1 41 srl %r13,1
22 l %r1,.Lget_ipl_device_addr-.LPG1(%r13) 42 GET_IPL_DEVICE
23 basr %r14,%r1
24 lhi %r1,1 # mode 1 = esame 43 lhi %r1,1 # mode 1 = esame
25 slr %r0,%r0 # set cpuid to zero 44 slr %r0,%r0 # set cpuid to zero
26 sigp %r1,%r0,0x12 # switch to esame mode 45 sigp %r1,%r0,0x12 # switch to esame mode
27 sam64 # switch to 64 bit mode 46 sam64 # switch to 64 bit mode
28 lctlg %c0,%c15,.Lctl-.LPG1(%r13) # load control registers 47 lctlg %c0,%c15,.Lctl-.LPG1(%r13) # load control registers
29 larl %r12,_pstart # pointer to parameter area 48 lg %r12,.Lparmaddr-.LPG1(%r13)# pointer to parameter area
30 # move IPL device to lowcore 49 # move IPL device to lowcore
31 mvc __LC_IPLDEV(4),IPL_DEVICE+4-PARMAREA(%r12) 50 mvc __LC_IPLDEV(4),IPL_DEVICE+4-PARMAREA(%r12)
32 51
@@ -55,8 +74,8 @@ startup:basr %r13,0 # get base
55 larl %r1,.Lsclph 74 larl %r1,.Lsclph
56 stg %r1,__LC_EXT_NEW_PSW+8 # set handler 75 stg %r1,__LC_EXT_NEW_PSW+8 # set handler
57 76
58 larl %r4,_pstart # %r4 is our index for sccb stuff 77 larl %r4,.Lsccb # %r4 is our index for sccb stuff
59 la %r1,.Lsccb-PARMAREA(%r4) # our sccb 78 lgr %r1,%r4 # our sccb
60 .insn rre,0xb2200000,%r2,%r1 # service call 79 .insn rre,0xb2200000,%r2,%r1 # service call
61 ipm %r1 80 ipm %r1
62 srl %r1,28 # get cc code 81 srl %r1,28 # get cc code
@@ -67,7 +86,7 @@ startup:basr %r13,0 # get base
67 be .Lservicecall-.LPG1(%r13) 86 be .Lservicecall-.LPG1(%r13)
68 lpswe .Lwaitsclp-.LPG1(%r13) 87 lpswe .Lwaitsclp-.LPG1(%r13)
69.Lsclph: 88.Lsclph:
70 lh %r1,.Lsccbr-PARMAREA(%r4) 89 lh %r1,.Lsccbr-.Lsccb(%r4)
71 chi %r1,0x10 # 0x0010 is the sucess code 90 chi %r1,0x10 # 0x0010 is the sucess code
72 je .Lprocsccb # let's process the sccb 91 je .Lprocsccb # let's process the sccb
73 chi %r1,0x1f0 92 chi %r1,0x1f0
@@ -78,15 +97,15 @@ startup:basr %r13,0 # get base
78 b .Lservicecall-.LPG1(%r13) 97 b .Lservicecall-.LPG1(%r13)
79.Lprocsccb: 98.Lprocsccb:
80 lghi %r1,0 99 lghi %r1,0
81 icm %r1,3,.Lscpincr1-PARMAREA(%r4) # use this one if != 0 100 icm %r1,3,.Lscpincr1-.Lsccb(%r4) # use this one if != 0
82 jnz .Lscnd 101 jnz .Lscnd
83 lg %r1,.Lscpincr2-PARMAREA(%r4) # otherwise use this one 102 lg %r1,.Lscpincr2-.Lsccb(%r4) # otherwise use this one
84.Lscnd: 103.Lscnd:
85 xr %r3,%r3 # same logic 104 xr %r3,%r3 # same logic
86 ic %r3,.Lscpa1-PARMAREA(%r4) 105 ic %r3,.Lscpa1-.Lsccb(%r4)
87 chi %r3,0x00 106 chi %r3,0x00
88 jne .Lcompmem 107 jne .Lcompmem
89 l %r3,.Lscpa2-PARMAREA(%r13) 108 l %r3,.Lscpa2-.Lsccb(%r4)
90.Lcompmem: 109.Lcompmem:
91 mlgr %r2,%r1 # mem in MB on 128-bit 110 mlgr %r2,%r1 # mem in MB on 128-bit
92 l %r1,.Lonemb-.LPG1(%r13) 111 l %r1,.Lonemb-.LPG1(%r13)
@@ -94,8 +113,6 @@ startup:basr %r13,0 # get base
94 b .Lfchunk-.LPG1(%r13) 113 b .Lfchunk-.LPG1(%r13)
95 114
96 .align 4 115 .align 4
97.Lget_ipl_device_addr:
98 .long .Lget_ipl_device
99.Lpmask: 116.Lpmask:
100 .byte 0 117 .byte 0
101 .align 8 118 .align 8
@@ -242,29 +259,16 @@ startup:basr %r13,0 # get base
242 .quad 0 # cr13: home space segment table 259 .quad 0 # cr13: home space segment table
243 .quad 0xc0000000 # cr14: machine check handling off 260 .quad 0xc0000000 # cr14: machine check handling off
244 .quad 0 # cr15: linkage stack operations 261 .quad 0 # cr15: linkage stack operations
262.Lduct: .long 0,0,0,0,0,0,0,0
263 .long 0,0,0,0,0,0,0,0
245.Lpcmsk:.quad 0x0000000180000000 264.Lpcmsk:.quad 0x0000000180000000
246.L4malign:.quad 0xffffffffffc00000 265.L4malign:.quad 0xffffffffffc00000
247.Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8 266.Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8
248.Lnop: .long 0x07000700 267.Lnop: .long 0x07000700
268.Lparmaddr:
269 .quad PARMAREA
249 270
250 .org PARMAREA-64 271 .align 4096
251.Lduct: .long 0,0,0,0,0,0,0,0
252 .long 0,0,0,0,0,0,0,0
253
254#
255# params at 10400 (setup.h)
256#
257 .org PARMAREA
258 .global _pstart
259_pstart:
260 .quad 0 # IPL_DEVICE
261 .quad RAMDISK_ORIGIN # INITRD_START
262 .quad RAMDISK_SIZE # INITRD_SIZE
263
264 .org COMMAND_LINE
265 .byte "root=/dev/ram0 ro"
266 .byte 0
267 .org 0x11000
268.Lsccb: 272.Lsccb:
269 .hword 0x1000 # length, one page 273 .hword 0x1000 # length, one page
270 .byte 0x00,0x00,0x00 274 .byte 0x00,0x00,0x00
@@ -281,18 +285,14 @@ _pstart:
281.Lscpincr2: 285.Lscpincr2:
282 .quad 0x00 286 .quad 0x00
283 .fill 3984,1,0 287 .fill 3984,1,0
284 .org 0x12000 288 .align 4096
285 .global _pend
286_pend:
287
288 GET_IPL_DEVICE
289 289
290#ifdef CONFIG_SHARED_KERNEL 290#ifdef CONFIG_SHARED_KERNEL
291 .org 0x100000 291 .org 0x100000
292#endif 292#endif
293 293
294# 294#
295# startup-code, running in virtual mode 295# startup-code, running in absolute addressing mode
296# 296#
297 .globl _stext 297 .globl _stext
298_stext: basr %r13,0 # get base 298_stext: basr %r13,0 # get base
@@ -326,4 +326,3 @@ _stext: basr %r13,0 # get base
326 .align 8 326 .align 8
327.Ldw: .quad 0x0002000180000000,0x0000000000000000 327.Ldw: .quad 0x0002000180000000,0x0000000000000000
328.Laregs: .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 328.Laregs: .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
329
diff --git a/arch/s390/kernel/s390_ksyms.c b/arch/s390/kernel/s390_ksyms.c
index 4176c77670c4..0886e739d122 100644
--- a/arch/s390/kernel/s390_ksyms.c
+++ b/arch/s390/kernel/s390_ksyms.c
@@ -46,8 +46,6 @@ EXPORT_SYMBOL(__down_interruptible);
46 */ 46 */
47extern int dump_fpu (struct pt_regs * regs, s390_fp_regs *fpregs); 47extern int dump_fpu (struct pt_regs * regs, s390_fp_regs *fpregs);
48EXPORT_SYMBOL(dump_fpu); 48EXPORT_SYMBOL(dump_fpu);
49EXPORT_SYMBOL(overflowuid);
50EXPORT_SYMBOL(overflowgid);
51EXPORT_SYMBOL(empty_zero_page); 49EXPORT_SYMBOL(empty_zero_page);
52 50
53/* 51/*
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index b282034452a4..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 */
@@ -289,19 +323,34 @@ void (*_machine_power_off)(void) = do_machine_power_off_nonsmp;
289 323
290void machine_restart(char *command) 324void machine_restart(char *command)
291{ 325{
292 console_unblank(); 326 if (!in_interrupt() || oops_in_progress)
327 /*
328 * Only unblank the console if we are called in enabled
329 * context or a bust_spinlocks cleared the way for us.
330 */
331 console_unblank();
293 _machine_restart(command); 332 _machine_restart(command);
294} 333}
295 334
296void machine_halt(void) 335void machine_halt(void)
297{ 336{
298 console_unblank(); 337 if (!in_interrupt() || oops_in_progress)
338 /*
339 * Only unblank the console if we are called in enabled
340 * context or a bust_spinlocks cleared the way for us.
341 */
342 console_unblank();
299 _machine_halt(); 343 _machine_halt();
300} 344}
301 345
302void machine_power_off(void) 346void machine_power_off(void)
303{ 347{
304 console_unblank(); 348 if (!in_interrupt() || oops_in_progress)
349 /*
350 * Only unblank the console if we are called in enabled
351 * context or a bust_spinlocks cleared the way for us.
352 */
353 console_unblank();
305 _machine_power_off(); 354 _machine_power_off();
306} 355}
307 356
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
index a46793beeddd..b7630436f693 100644
--- a/arch/s390/kernel/traps.c
+++ b/arch/s390/kernel/traps.c
@@ -150,13 +150,11 @@ void show_stack(struct task_struct *task, unsigned long *sp)
150 unsigned long *stack; 150 unsigned long *stack;
151 int i; 151 int i;
152 152
153 // debugging aid: "show_stack(NULL);" prints the
154 // back trace for this cpu.
155
156 if (!sp) 153 if (!sp)
157 sp = task ? (unsigned long *) task->thread.ksp : __r15; 154 stack = task ? (unsigned long *) task->thread.ksp : __r15;
155 else
156 stack = sp;
158 157
159 stack = sp;
160 for (i = 0; i < kstack_depth_to_print; i++) { 158 for (i = 0; i < kstack_depth_to_print; i++) {
161 if (((addr_t) stack & (THREAD_SIZE-1)) == 0) 159 if (((addr_t) stack & (THREAD_SIZE-1)) == 0)
162 break; 160 break;