diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-22 21:15:32 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-22 21:15:32 -0400 |
| commit | db1417967959569599da2a4bd0ffb93b17ad795f (patch) | |
| tree | 08751414d5f4a9e264af924154ed3543a8e573a9 /arch/s390/include | |
| parent | 48aab2f79dfc1357c48ce22ff5c989b52a590069 (diff) | |
| parent | c6da39f26cfe475704ec521723192e520e8f51b8 (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 patches from Martin Schwidefsky:
"The biggest patch is the rework of the smp code, something I wanted to
do for some time. There are some patches for our various dump methods
and one new thing: z/VM LGR detection. LGR stands for linux-guest-
relocation and is the guest migration feature of z/VM. For debugging
purposes we keep a log of the systems where a specific guest has lived."
Fix up trivial conflict in arch/s390/kernel/smp.c due to the scheduler
cleanup having removed some code next to removed s390 code.
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
[S390] kernel: Pass correct stack for smp_call_ipl_cpu()
[S390] Ensure that vmcore_info pointer is never accessed directly
[S390] dasd: prevent validate server for offline devices
[S390] Remove monolithic build option for zcrypt driver.
[S390] stack dump: fix indentation in output
[S390] kernel: Add OS info memory interface
[S390] Use block_sigmask()
[S390] kernel: Add z/VM LGR detection
[S390] irq: external interrupt code passing
[S390] irq: set __ARCH_IRQ_EXIT_IRQS_DISABLED
[S390] zfcpdump: Implement async sdias event processing
[S390] Use copy_to_absolute_zero() instead of "stura/sturg"
[S390] rework idle code
[S390] rework smp code
[S390] rename lowcore field
[S390] Fix gcc 4.6.0 compile warning
Diffstat (limited to 'arch/s390/include')
| -rw-r--r-- | arch/s390/include/asm/cputime.h | 9 | ||||
| -rw-r--r-- | arch/s390/include/asm/debug.h | 1 | ||||
| -rw-r--r-- | arch/s390/include/asm/hardirq.h | 1 | ||||
| -rw-r--r-- | arch/s390/include/asm/ipl.h | 1 | ||||
| -rw-r--r-- | arch/s390/include/asm/irq.h | 7 | ||||
| -rw-r--r-- | arch/s390/include/asm/lowcore.h | 119 | ||||
| -rw-r--r-- | arch/s390/include/asm/os_info.h | 50 | ||||
| -rw-r--r-- | arch/s390/include/asm/sigp.h | 132 | ||||
| -rw-r--r-- | arch/s390/include/asm/smp.h | 63 | ||||
| -rw-r--r-- | arch/s390/include/asm/system.h | 34 | ||||
| -rw-r--r-- | arch/s390/include/asm/timer.h | 4 | ||||
| -rw-r--r-- | arch/s390/include/asm/vdso.h | 4 |
12 files changed, 185 insertions, 240 deletions
diff --git a/arch/s390/include/asm/cputime.h b/arch/s390/include/asm/cputime.h index c23c3900c304..24ef186a1c4f 100644 --- a/arch/s390/include/asm/cputime.h +++ b/arch/s390/include/asm/cputime.h | |||
| @@ -170,24 +170,17 @@ struct s390_idle_data { | |||
| 170 | unsigned int sequence; | 170 | unsigned int sequence; |
| 171 | unsigned long long idle_count; | 171 | unsigned long long idle_count; |
| 172 | unsigned long long idle_enter; | 172 | unsigned long long idle_enter; |
| 173 | unsigned long long idle_exit; | ||
| 173 | unsigned long long idle_time; | 174 | unsigned long long idle_time; |
| 174 | int nohz_delay; | 175 | int nohz_delay; |
| 175 | }; | 176 | }; |
| 176 | 177 | ||
| 177 | DECLARE_PER_CPU(struct s390_idle_data, s390_idle); | 178 | DECLARE_PER_CPU(struct s390_idle_data, s390_idle); |
| 178 | 179 | ||
| 179 | void vtime_start_cpu(__u64 int_clock, __u64 enter_timer); | ||
| 180 | cputime64_t s390_get_idle_time(int cpu); | 180 | cputime64_t s390_get_idle_time(int cpu); |
| 181 | 181 | ||
| 182 | #define arch_idle_time(cpu) s390_get_idle_time(cpu) | 182 | #define arch_idle_time(cpu) s390_get_idle_time(cpu) |
| 183 | 183 | ||
| 184 | static inline void s390_idle_check(struct pt_regs *regs, __u64 int_clock, | ||
| 185 | __u64 enter_timer) | ||
| 186 | { | ||
| 187 | if (regs->psw.mask & PSW_MASK_WAIT) | ||
| 188 | vtime_start_cpu(int_clock, enter_timer); | ||
| 189 | } | ||
| 190 | |||
| 191 | static inline int s390_nohz_delay(int cpu) | 184 | static inline int s390_nohz_delay(int cpu) |
| 192 | { | 185 | { |
| 193 | return __get_cpu_var(s390_idle).nohz_delay != 0; | 186 | return __get_cpu_var(s390_idle).nohz_delay != 0; |
diff --git a/arch/s390/include/asm/debug.h b/arch/s390/include/asm/debug.h index 9d88db1f55d0..8a8245ed14d2 100644 --- a/arch/s390/include/asm/debug.h +++ b/arch/s390/include/asm/debug.h | |||
| @@ -131,6 +131,7 @@ void debug_unregister(debug_info_t* id); | |||
| 131 | 131 | ||
| 132 | void debug_set_level(debug_info_t* id, int new_level); | 132 | void debug_set_level(debug_info_t* id, int new_level); |
| 133 | 133 | ||
| 134 | void debug_set_critical(void); | ||
| 134 | void debug_stop_all(void); | 135 | void debug_stop_all(void); |
| 135 | 136 | ||
| 136 | static inline debug_entry_t* | 137 | static inline debug_entry_t* |
diff --git a/arch/s390/include/asm/hardirq.h b/arch/s390/include/asm/hardirq.h index e4155d3eb2cb..510ba9ef4248 100644 --- a/arch/s390/include/asm/hardirq.h +++ b/arch/s390/include/asm/hardirq.h | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | 18 | ||
| 19 | #define __ARCH_IRQ_STAT | 19 | #define __ARCH_IRQ_STAT |
| 20 | #define __ARCH_HAS_DO_SOFTIRQ | 20 | #define __ARCH_HAS_DO_SOFTIRQ |
| 21 | #define __ARCH_IRQ_EXIT_IRQS_DISABLED | ||
| 21 | 22 | ||
| 22 | #define HARDIRQ_BITS 8 | 23 | #define HARDIRQ_BITS 8 |
| 23 | 24 | ||
diff --git a/arch/s390/include/asm/ipl.h b/arch/s390/include/asm/ipl.h index 6940abfbe1d9..2bd6cb897b90 100644 --- a/arch/s390/include/asm/ipl.h +++ b/arch/s390/include/asm/ipl.h | |||
| @@ -169,5 +169,6 @@ enum diag308_rc { | |||
| 169 | extern int diag308(unsigned long subcode, void *addr); | 169 | extern int diag308(unsigned long subcode, void *addr); |
| 170 | extern void diag308_reset(void); | 170 | extern void diag308_reset(void); |
| 171 | extern void store_status(void); | 171 | extern void store_status(void); |
| 172 | extern void lgr_info_log(void); | ||
| 172 | 173 | ||
| 173 | #endif /* _ASM_S390_IPL_H */ | 174 | #endif /* _ASM_S390_IPL_H */ |
diff --git a/arch/s390/include/asm/irq.h b/arch/s390/include/asm/irq.h index ba6d85f88d50..acee1806f61e 100644 --- a/arch/s390/include/asm/irq.h +++ b/arch/s390/include/asm/irq.h | |||
| @@ -34,7 +34,12 @@ enum interruption_class { | |||
| 34 | NR_IRQS, | 34 | NR_IRQS, |
| 35 | }; | 35 | }; |
| 36 | 36 | ||
| 37 | typedef void (*ext_int_handler_t)(unsigned int, unsigned int, unsigned long); | 37 | struct ext_code { |
| 38 | unsigned short subcode; | ||
| 39 | unsigned short code; | ||
| 40 | }; | ||
| 41 | |||
| 42 | typedef void (*ext_int_handler_t)(struct ext_code, unsigned int, unsigned long); | ||
| 38 | 43 | ||
| 39 | int register_external_interrupt(u16 code, ext_int_handler_t handler); | 44 | int register_external_interrupt(u16 code, ext_int_handler_t handler); |
| 40 | int unregister_external_interrupt(u16 code, ext_int_handler_t handler); | 45 | int unregister_external_interrupt(u16 code, ext_int_handler_t handler); |
diff --git a/arch/s390/include/asm/lowcore.h b/arch/s390/include/asm/lowcore.h index 707f2306725b..47853debb3b9 100644 --- a/arch/s390/include/asm/lowcore.h +++ b/arch/s390/include/asm/lowcore.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright IBM Corp. 1999,2010 | 2 | * Copyright IBM Corp. 1999,2012 |
| 3 | * Author(s): Hartmut Penner <hp@de.ibm.com>, | 3 | * Author(s): Hartmut Penner <hp@de.ibm.com>, |
| 4 | * Martin Schwidefsky <schwidefsky@de.ibm.com>, | 4 | * Martin Schwidefsky <schwidefsky@de.ibm.com>, |
| 5 | * Denis Joseph Barrow, | 5 | * Denis Joseph Barrow, |
| @@ -12,14 +12,6 @@ | |||
| 12 | #include <asm/ptrace.h> | 12 | #include <asm/ptrace.h> |
| 13 | #include <asm/cpu.h> | 13 | #include <asm/cpu.h> |
| 14 | 14 | ||
| 15 | void restart_int_handler(void); | ||
| 16 | void ext_int_handler(void); | ||
| 17 | void system_call(void); | ||
| 18 | void pgm_check_handler(void); | ||
| 19 | void mcck_int_handler(void); | ||
| 20 | void io_int_handler(void); | ||
| 21 | void psw_restart_int_handler(void); | ||
| 22 | |||
| 23 | #ifdef CONFIG_32BIT | 15 | #ifdef CONFIG_32BIT |
| 24 | 16 | ||
| 25 | #define LC_ORDER 0 | 17 | #define LC_ORDER 0 |
| @@ -56,7 +48,7 @@ struct _lowcore { | |||
| 56 | psw_t mcck_new_psw; /* 0x0070 */ | 48 | psw_t mcck_new_psw; /* 0x0070 */ |
| 57 | psw_t io_new_psw; /* 0x0078 */ | 49 | psw_t io_new_psw; /* 0x0078 */ |
| 58 | __u32 ext_params; /* 0x0080 */ | 50 | __u32 ext_params; /* 0x0080 */ |
| 59 | __u16 cpu_addr; /* 0x0084 */ | 51 | __u16 ext_cpu_addr; /* 0x0084 */ |
| 60 | __u16 ext_int_code; /* 0x0086 */ | 52 | __u16 ext_int_code; /* 0x0086 */ |
| 61 | __u16 svc_ilc; /* 0x0088 */ | 53 | __u16 svc_ilc; /* 0x0088 */ |
| 62 | __u16 svc_code; /* 0x008a */ | 54 | __u16 svc_code; /* 0x008a */ |
| @@ -117,32 +109,37 @@ struct _lowcore { | |||
| 117 | __u64 steal_timer; /* 0x0288 */ | 109 | __u64 steal_timer; /* 0x0288 */ |
| 118 | __u64 last_update_timer; /* 0x0290 */ | 110 | __u64 last_update_timer; /* 0x0290 */ |
| 119 | __u64 last_update_clock; /* 0x0298 */ | 111 | __u64 last_update_clock; /* 0x0298 */ |
| 112 | __u64 int_clock; /* 0x02a0 */ | ||
| 113 | __u64 mcck_clock; /* 0x02a8 */ | ||
| 114 | __u64 clock_comparator; /* 0x02b0 */ | ||
| 120 | 115 | ||
| 121 | /* Current process. */ | 116 | /* Current process. */ |
| 122 | __u32 current_task; /* 0x02a0 */ | 117 | __u32 current_task; /* 0x02b8 */ |
| 123 | __u32 thread_info; /* 0x02a4 */ | 118 | __u32 thread_info; /* 0x02bc */ |
| 124 | __u32 kernel_stack; /* 0x02a8 */ | 119 | __u32 kernel_stack; /* 0x02c0 */ |
| 120 | |||
| 121 | /* Interrupt, panic and restart stack. */ | ||
| 122 | __u32 async_stack; /* 0x02c4 */ | ||
| 123 | __u32 panic_stack; /* 0x02c8 */ | ||
| 124 | __u32 restart_stack; /* 0x02cc */ | ||
| 125 | 125 | ||
| 126 | /* Interrupt and panic stack. */ | 126 | /* Restart function and parameter. */ |
| 127 | __u32 async_stack; /* 0x02ac */ | 127 | __u32 restart_fn; /* 0x02d0 */ |
| 128 | __u32 panic_stack; /* 0x02b0 */ | 128 | __u32 restart_data; /* 0x02d4 */ |
| 129 | __u32 restart_source; /* 0x02d8 */ | ||
| 129 | 130 | ||
| 130 | /* Address space pointer. */ | 131 | /* Address space pointer. */ |
| 131 | __u32 kernel_asce; /* 0x02b4 */ | 132 | __u32 kernel_asce; /* 0x02dc */ |
| 132 | __u32 user_asce; /* 0x02b8 */ | 133 | __u32 user_asce; /* 0x02e0 */ |
| 133 | __u32 current_pid; /* 0x02bc */ | 134 | __u32 current_pid; /* 0x02e4 */ |
| 134 | 135 | ||
| 135 | /* SMP info area */ | 136 | /* SMP info area */ |
| 136 | __u32 cpu_nr; /* 0x02c0 */ | 137 | __u32 cpu_nr; /* 0x02e8 */ |
| 137 | __u32 softirq_pending; /* 0x02c4 */ | 138 | __u32 softirq_pending; /* 0x02ec */ |
| 138 | __u32 percpu_offset; /* 0x02c8 */ | 139 | __u32 percpu_offset; /* 0x02f0 */ |
| 139 | __u32 ext_call_fast; /* 0x02cc */ | 140 | __u32 machine_flags; /* 0x02f4 */ |
| 140 | __u64 int_clock; /* 0x02d0 */ | 141 | __u32 ftrace_func; /* 0x02f8 */ |
| 141 | __u64 mcck_clock; /* 0x02d8 */ | 142 | __u8 pad_0x02fc[0x0300-0x02fc]; /* 0x02fc */ |
| 142 | __u64 clock_comparator; /* 0x02e0 */ | ||
| 143 | __u32 machine_flags; /* 0x02e8 */ | ||
| 144 | __u32 ftrace_func; /* 0x02ec */ | ||
| 145 | __u8 pad_0x02f8[0x0300-0x02f0]; /* 0x02f0 */ | ||
| 146 | 143 | ||
| 147 | /* Interrupt response block */ | 144 | /* Interrupt response block */ |
| 148 | __u8 irb[64]; /* 0x0300 */ | 145 | __u8 irb[64]; /* 0x0300 */ |
| @@ -157,7 +154,9 @@ struct _lowcore { | |||
| 157 | __u32 ipib; /* 0x0e00 */ | 154 | __u32 ipib; /* 0x0e00 */ |
| 158 | __u32 ipib_checksum; /* 0x0e04 */ | 155 | __u32 ipib_checksum; /* 0x0e04 */ |
| 159 | __u32 vmcore_info; /* 0x0e08 */ | 156 | __u32 vmcore_info; /* 0x0e08 */ |
| 160 | __u8 pad_0x0e0c[0x0f00-0x0e0c]; /* 0x0e0c */ | 157 | __u8 pad_0x0e0c[0x0e18-0x0e0c]; /* 0x0e0c */ |
| 158 | __u32 os_info; /* 0x0e18 */ | ||
| 159 | __u8 pad_0x0e1c[0x0f00-0x0e1c]; /* 0x0e1c */ | ||
| 161 | 160 | ||
| 162 | /* Extended facility list */ | 161 | /* Extended facility list */ |
| 163 | __u64 stfle_fac_list[32]; /* 0x0f00 */ | 162 | __u64 stfle_fac_list[32]; /* 0x0f00 */ |
| @@ -189,7 +188,7 @@ struct _lowcore { | |||
| 189 | __u32 ipl_parmblock_ptr; /* 0x0014 */ | 188 | __u32 ipl_parmblock_ptr; /* 0x0014 */ |
| 190 | __u8 pad_0x0018[0x0080-0x0018]; /* 0x0018 */ | 189 | __u8 pad_0x0018[0x0080-0x0018]; /* 0x0018 */ |
| 191 | __u32 ext_params; /* 0x0080 */ | 190 | __u32 ext_params; /* 0x0080 */ |
| 192 | __u16 cpu_addr; /* 0x0084 */ | 191 | __u16 ext_cpu_addr; /* 0x0084 */ |
| 193 | __u16 ext_int_code; /* 0x0086 */ | 192 | __u16 ext_int_code; /* 0x0086 */ |
| 194 | __u16 svc_ilc; /* 0x0088 */ | 193 | __u16 svc_ilc; /* 0x0088 */ |
| 195 | __u16 svc_code; /* 0x008a */ | 194 | __u16 svc_code; /* 0x008a */ |
| @@ -254,34 +253,39 @@ struct _lowcore { | |||
| 254 | __u64 steal_timer; /* 0x02e0 */ | 253 | __u64 steal_timer; /* 0x02e0 */ |
| 255 | __u64 last_update_timer; /* 0x02e8 */ | 254 | __u64 last_update_timer; /* 0x02e8 */ |
| 256 | __u64 last_update_clock; /* 0x02f0 */ | 255 | __u64 last_update_clock; /* 0x02f0 */ |
| 256 | __u64 int_clock; /* 0x02f8 */ | ||
| 257 | __u64 mcck_clock; /* 0x0300 */ | ||
| 258 | __u64 clock_comparator; /* 0x0308 */ | ||
| 257 | 259 | ||
| 258 | /* Current process. */ | 260 | /* Current process. */ |
| 259 | __u64 current_task; /* 0x02f8 */ | 261 | __u64 current_task; /* 0x0310 */ |
| 260 | __u64 thread_info; /* 0x0300 */ | 262 | __u64 thread_info; /* 0x0318 */ |
| 261 | __u64 kernel_stack; /* 0x0308 */ | 263 | __u64 kernel_stack; /* 0x0320 */ |
| 264 | |||
| 265 | /* Interrupt, panic and restart stack. */ | ||
| 266 | __u64 async_stack; /* 0x0328 */ | ||
| 267 | __u64 panic_stack; /* 0x0330 */ | ||
| 268 | __u64 restart_stack; /* 0x0338 */ | ||
| 262 | 269 | ||
| 263 | /* Interrupt and panic stack. */ | 270 | /* Restart function and parameter. */ |
| 264 | __u64 async_stack; /* 0x0310 */ | 271 | __u64 restart_fn; /* 0x0340 */ |
| 265 | __u64 panic_stack; /* 0x0318 */ | 272 | __u64 restart_data; /* 0x0348 */ |
| 273 | __u64 restart_source; /* 0x0350 */ | ||
| 266 | 274 | ||
| 267 | /* Address space pointer. */ | 275 | /* Address space pointer. */ |
| 268 | __u64 kernel_asce; /* 0x0320 */ | 276 | __u64 kernel_asce; /* 0x0358 */ |
| 269 | __u64 user_asce; /* 0x0328 */ | 277 | __u64 user_asce; /* 0x0360 */ |
| 270 | __u64 current_pid; /* 0x0330 */ | 278 | __u64 current_pid; /* 0x0368 */ |
| 271 | 279 | ||
| 272 | /* SMP info area */ | 280 | /* SMP info area */ |
| 273 | __u32 cpu_nr; /* 0x0338 */ | 281 | __u32 cpu_nr; /* 0x0370 */ |
| 274 | __u32 softirq_pending; /* 0x033c */ | 282 | __u32 softirq_pending; /* 0x0374 */ |
| 275 | __u64 percpu_offset; /* 0x0340 */ | 283 | __u64 percpu_offset; /* 0x0378 */ |
| 276 | __u64 ext_call_fast; /* 0x0348 */ | 284 | __u64 vdso_per_cpu_data; /* 0x0380 */ |
| 277 | __u64 int_clock; /* 0x0350 */ | 285 | __u64 machine_flags; /* 0x0388 */ |
| 278 | __u64 mcck_clock; /* 0x0358 */ | 286 | __u64 ftrace_func; /* 0x0390 */ |
| 279 | __u64 clock_comparator; /* 0x0360 */ | 287 | __u64 gmap; /* 0x0398 */ |
| 280 | __u64 vdso_per_cpu_data; /* 0x0368 */ | 288 | __u8 pad_0x03a0[0x0400-0x03a0]; /* 0x03a0 */ |
| 281 | __u64 machine_flags; /* 0x0370 */ | ||
| 282 | __u64 ftrace_func; /* 0x0378 */ | ||
| 283 | __u64 gmap; /* 0x0380 */ | ||
| 284 | __u8 pad_0x0388[0x0400-0x0388]; /* 0x0388 */ | ||
| 285 | 289 | ||
| 286 | /* Interrupt response block. */ | 290 | /* Interrupt response block. */ |
| 287 | __u8 irb[64]; /* 0x0400 */ | 291 | __u8 irb[64]; /* 0x0400 */ |
| @@ -298,8 +302,15 @@ struct _lowcore { | |||
| 298 | */ | 302 | */ |
| 299 | __u64 ipib; /* 0x0e00 */ | 303 | __u64 ipib; /* 0x0e00 */ |
| 300 | __u32 ipib_checksum; /* 0x0e08 */ | 304 | __u32 ipib_checksum; /* 0x0e08 */ |
| 301 | __u64 vmcore_info; /* 0x0e0c */ | 305 | /* |
| 302 | __u8 pad_0x0e14[0x0f00-0x0e14]; /* 0x0e14 */ | 306 | * Because the vmcore_info pointer is not 8 byte aligned it never |
| 307 | * should not be accessed directly. For accessing the pointer, first | ||
| 308 | * copy it to a local pointer variable. | ||
| 309 | */ | ||
| 310 | __u8 vmcore_info[8]; /* 0x0e0c */ | ||
| 311 | __u8 pad_0x0e14[0x0e18-0x0e14]; /* 0x0e14 */ | ||
| 312 | __u64 os_info; /* 0x0e18 */ | ||
| 313 | __u8 pad_0x0e20[0x0f00-0x0e20]; /* 0x0e20 */ | ||
| 303 | 314 | ||
| 304 | /* Extended facility list */ | 315 | /* Extended facility list */ |
| 305 | __u64 stfle_fac_list[32]; /* 0x0f00 */ | 316 | __u64 stfle_fac_list[32]; /* 0x0f00 */ |
diff --git a/arch/s390/include/asm/os_info.h b/arch/s390/include/asm/os_info.h new file mode 100644 index 000000000000..d07518af09ea --- /dev/null +++ b/arch/s390/include/asm/os_info.h | |||
| @@ -0,0 +1,50 @@ | |||
| 1 | /* | ||
| 2 | * OS info memory interface | ||
| 3 | * | ||
| 4 | * Copyright IBM Corp. 2012 | ||
| 5 | * Author(s): Michael Holzheu <holzheu@linux.vnet.ibm.com> | ||
| 6 | */ | ||
| 7 | #ifndef _ASM_S390_OS_INFO_H | ||
| 8 | #define _ASM_S390_OS_INFO_H | ||
| 9 | |||
| 10 | #define OS_INFO_VERSION_MAJOR 1 | ||
| 11 | #define OS_INFO_VERSION_MINOR 1 | ||
| 12 | #define OS_INFO_MAGIC 0x4f53494e464f535aULL /* OSINFOSZ */ | ||
| 13 | |||
| 14 | #define OS_INFO_VMCOREINFO 0 | ||
| 15 | #define OS_INFO_REIPL_BLOCK 1 | ||
| 16 | #define OS_INFO_INIT_FN 2 | ||
| 17 | |||
| 18 | struct os_info_entry { | ||
| 19 | u64 addr; | ||
| 20 | u64 size; | ||
| 21 | u32 csum; | ||
| 22 | } __packed; | ||
| 23 | |||
| 24 | struct os_info { | ||
| 25 | u64 magic; | ||
| 26 | u32 csum; | ||
| 27 | u16 version_major; | ||
| 28 | u16 version_minor; | ||
| 29 | u64 crashkernel_addr; | ||
| 30 | u64 crashkernel_size; | ||
| 31 | struct os_info_entry entry[3]; | ||
| 32 | u8 reserved[4004]; | ||
| 33 | } __packed; | ||
| 34 | |||
| 35 | void os_info_init(void); | ||
| 36 | void os_info_entry_add(int nr, void *ptr, u64 len); | ||
| 37 | void os_info_crashkernel_add(unsigned long base, unsigned long size); | ||
| 38 | u32 os_info_csum(struct os_info *os_info); | ||
| 39 | |||
| 40 | #ifdef CONFIG_CRASH_DUMP | ||
| 41 | void *os_info_old_entry(int nr, unsigned long *size); | ||
| 42 | int copy_from_oldmem(void *dest, void *src, size_t count); | ||
| 43 | #else | ||
| 44 | static inline void *os_info_old_entry(int nr, unsigned long *size) | ||
| 45 | { | ||
| 46 | return NULL; | ||
| 47 | } | ||
| 48 | #endif | ||
| 49 | |||
| 50 | #endif /* _ASM_S390_OS_INFO_H */ | ||
diff --git a/arch/s390/include/asm/sigp.h b/arch/s390/include/asm/sigp.h deleted file mode 100644 index 7040b8567cd0..000000000000 --- a/arch/s390/include/asm/sigp.h +++ /dev/null | |||
| @@ -1,132 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Routines and structures for signalling other processors. | ||
| 3 | * | ||
| 4 | * Copyright IBM Corp. 1999,2010 | ||
| 5 | * Author(s): Denis Joseph Barrow, | ||
| 6 | * Martin Schwidefsky <schwidefsky@de.ibm.com>, | ||
| 7 | * Heiko Carstens <heiko.carstens@de.ibm.com>, | ||
| 8 | */ | ||
| 9 | |||
| 10 | #ifndef __ASM_SIGP_H | ||
| 11 | #define __ASM_SIGP_H | ||
| 12 | |||
| 13 | #include <asm/system.h> | ||
| 14 | |||
| 15 | /* Get real cpu address from logical cpu number. */ | ||
| 16 | extern unsigned short __cpu_logical_map[]; | ||
| 17 | |||
| 18 | static inline int cpu_logical_map(int cpu) | ||
| 19 | { | ||
| 20 | #ifdef CONFIG_SMP | ||
| 21 | return __cpu_logical_map[cpu]; | ||
| 22 | #else | ||
| 23 | return stap(); | ||
| 24 | #endif | ||
| 25 | } | ||
| 26 | |||
| 27 | enum { | ||
| 28 | sigp_sense = 1, | ||
| 29 | sigp_external_call = 2, | ||
| 30 | sigp_emergency_signal = 3, | ||
| 31 | sigp_start = 4, | ||
| 32 | sigp_stop = 5, | ||
| 33 | sigp_restart = 6, | ||
| 34 | sigp_stop_and_store_status = 9, | ||
| 35 | sigp_initial_cpu_reset = 11, | ||
| 36 | sigp_cpu_reset = 12, | ||
| 37 | sigp_set_prefix = 13, | ||
| 38 | sigp_store_status_at_address = 14, | ||
| 39 | sigp_store_extended_status_at_address = 15, | ||
| 40 | sigp_set_architecture = 18, | ||
| 41 | sigp_conditional_emergency_signal = 19, | ||
| 42 | sigp_sense_running = 21, | ||
| 43 | }; | ||
| 44 | |||
| 45 | enum { | ||
| 46 | sigp_order_code_accepted = 0, | ||
| 47 | sigp_status_stored = 1, | ||
| 48 | sigp_busy = 2, | ||
| 49 | sigp_not_operational = 3, | ||
| 50 | }; | ||
| 51 | |||
| 52 | /* | ||
| 53 | * Definitions for external call. | ||
| 54 | */ | ||
| 55 | enum { | ||
| 56 | ec_schedule = 0, | ||
| 57 | ec_call_function, | ||
| 58 | ec_call_function_single, | ||
| 59 | ec_stop_cpu, | ||
| 60 | }; | ||
| 61 | |||
| 62 | /* | ||
| 63 | * Signal processor. | ||
| 64 | */ | ||
| 65 | static inline int raw_sigp(u16 cpu, int order) | ||
| 66 | { | ||
| 67 | register unsigned long reg1 asm ("1") = 0; | ||
| 68 | int ccode; | ||
| 69 | |||
| 70 | asm volatile( | ||
| 71 | " sigp %1,%2,0(%3)\n" | ||
| 72 | " ipm %0\n" | ||
| 73 | " srl %0,28\n" | ||
| 74 | : "=d" (ccode) | ||
| 75 | : "d" (reg1), "d" (cpu), | ||
| 76 | "a" (order) : "cc" , "memory"); | ||
| 77 | return ccode; | ||
| 78 | } | ||
| 79 | |||
| 80 | /* | ||
| 81 | * Signal processor with parameter. | ||
| 82 | */ | ||
| 83 | static inline int raw_sigp_p(u32 parameter, u16 cpu, int order) | ||
| 84 | { | ||
| 85 | register unsigned int reg1 asm ("1") = parameter; | ||
| 86 | int ccode; | ||
| 87 | |||
| 88 | asm volatile( | ||
| 89 | " sigp %1,%2,0(%3)\n" | ||
| 90 | " ipm %0\n" | ||
| 91 | " srl %0,28\n" | ||
| 92 | : "=d" (ccode) | ||
| 93 | : "d" (reg1), "d" (cpu), | ||
| 94 | "a" (order) : "cc" , "memory"); | ||
| 95 | return ccode; | ||
| 96 | } | ||
| 97 | |||
| 98 | /* | ||
| 99 | * Signal processor with parameter and return status. | ||
| 100 | */ | ||
| 101 | static inline int raw_sigp_ps(u32 *status, u32 parm, u16 cpu, int order) | ||
| 102 | { | ||
| 103 | register unsigned int reg1 asm ("1") = parm; | ||
| 104 | int ccode; | ||
| 105 | |||
| 106 | asm volatile( | ||
| 107 | " sigp %1,%2,0(%3)\n" | ||
| 108 | " ipm %0\n" | ||
| 109 | " srl %0,28\n" | ||
| 110 | : "=d" (ccode), "+d" (reg1) | ||
| 111 | : "d" (cpu), "a" (order) | ||
| 112 | : "cc" , "memory"); | ||
| 113 | *status = reg1; | ||
| 114 | return ccode; | ||
| 115 | } | ||
| 116 | |||
| 117 | static inline int sigp(int cpu, int order) | ||
| 118 | { | ||
| 119 | return raw_sigp(cpu_logical_map(cpu), order); | ||
| 120 | } | ||
| 121 | |||
| 122 | static inline int sigp_p(u32 parameter, int cpu, int order) | ||
| 123 | { | ||
| 124 | return raw_sigp_p(parameter, cpu_logical_map(cpu), order); | ||
| 125 | } | ||
| 126 | |||
| 127 | static inline int sigp_ps(u32 *status, u32 parm, int cpu, int order) | ||
| 128 | { | ||
| 129 | return raw_sigp_ps(status, parm, cpu_logical_map(cpu), order); | ||
| 130 | } | ||
| 131 | |||
| 132 | #endif /* __ASM_SIGP_H */ | ||
diff --git a/arch/s390/include/asm/smp.h b/arch/s390/include/asm/smp.h index c32e9123b40c..797f78729680 100644 --- a/arch/s390/include/asm/smp.h +++ b/arch/s390/include/asm/smp.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright IBM Corp. 1999,2009 | 2 | * Copyright IBM Corp. 1999,2012 |
| 3 | * Author(s): Denis Joseph Barrow, | 3 | * Author(s): Denis Joseph Barrow, |
| 4 | * Martin Schwidefsky <schwidefsky@de.ibm.com>, | 4 | * Martin Schwidefsky <schwidefsky@de.ibm.com>, |
| 5 | * Heiko Carstens <heiko.carstens@de.ibm.com>, | 5 | * Heiko Carstens <heiko.carstens@de.ibm.com>, |
| @@ -10,71 +10,52 @@ | |||
| 10 | #ifdef CONFIG_SMP | 10 | #ifdef CONFIG_SMP |
| 11 | 11 | ||
| 12 | #include <asm/system.h> | 12 | #include <asm/system.h> |
| 13 | #include <asm/sigp.h> | ||
| 14 | |||
| 15 | extern void machine_restart_smp(char *); | ||
| 16 | extern void machine_halt_smp(void); | ||
| 17 | extern void machine_power_off_smp(void); | ||
| 18 | 13 | ||
| 19 | #define raw_smp_processor_id() (S390_lowcore.cpu_nr) | 14 | #define raw_smp_processor_id() (S390_lowcore.cpu_nr) |
| 20 | 15 | ||
| 21 | extern int __cpu_disable (void); | ||
| 22 | extern void __cpu_die (unsigned int cpu); | ||
| 23 | extern int __cpu_up (unsigned int cpu); | ||
| 24 | |||
| 25 | extern struct mutex smp_cpu_state_mutex; | 16 | extern struct mutex smp_cpu_state_mutex; |
| 17 | extern struct save_area *zfcpdump_save_areas[NR_CPUS + 1]; | ||
| 18 | |||
| 19 | extern int __cpu_up(unsigned int cpu); | ||
| 26 | 20 | ||
| 27 | extern void arch_send_call_function_single_ipi(int cpu); | 21 | extern void arch_send_call_function_single_ipi(int cpu); |
| 28 | extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); | 22 | extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); |
| 29 | 23 | ||
| 30 | extern struct save_area *zfcpdump_save_areas[NR_CPUS + 1]; | 24 | extern void smp_call_online_cpu(void (*func)(void *), void *); |
| 31 | 25 | extern void smp_call_ipl_cpu(void (*func)(void *), void *); | |
| 32 | extern void smp_switch_to_ipl_cpu(void (*func)(void *), void *); | ||
| 33 | extern void smp_switch_to_cpu(void (*)(void *), void *, unsigned long sp, | ||
| 34 | int from, int to); | ||
| 35 | extern void smp_restart_with_online_cpu(void); | ||
| 36 | extern void smp_restart_cpu(void); | ||
| 37 | 26 | ||
| 38 | /* | 27 | extern int smp_find_processor_id(u16 address); |
| 39 | * returns 1 if (virtual) cpu is scheduled | 28 | extern int smp_store_status(int cpu); |
| 40 | * returns 0 otherwise | 29 | extern int smp_vcpu_scheduled(int cpu); |
| 41 | */ | 30 | extern void smp_yield_cpu(int cpu); |
| 42 | static inline int smp_vcpu_scheduled(int cpu) | 31 | extern void smp_yield(void); |
| 43 | { | 32 | extern void smp_stop_cpu(void); |
| 44 | u32 status; | ||
| 45 | |||
| 46 | switch (sigp_ps(&status, 0, cpu, sigp_sense_running)) { | ||
| 47 | case sigp_status_stored: | ||
| 48 | /* Check for running status */ | ||
| 49 | if (status & 0x400) | ||
| 50 | return 0; | ||
| 51 | break; | ||
| 52 | case sigp_not_operational: | ||
| 53 | return 0; | ||
| 54 | default: | ||
| 55 | break; | ||
| 56 | } | ||
| 57 | return 1; | ||
| 58 | } | ||
| 59 | 33 | ||
| 60 | #else /* CONFIG_SMP */ | 34 | #else /* CONFIG_SMP */ |
| 61 | 35 | ||
| 62 | static inline void smp_switch_to_ipl_cpu(void (*func)(void *), void *data) | 36 | static inline void smp_call_ipl_cpu(void (*func)(void *), void *data) |
| 63 | { | 37 | { |
| 64 | func(data); | 38 | func(data); |
| 65 | } | 39 | } |
| 66 | 40 | ||
| 67 | static inline void smp_restart_with_online_cpu(void) | 41 | static inline void smp_call_online_cpu(void (*func)(void *), void *data) |
| 68 | { | 42 | { |
| 43 | func(data); | ||
| 69 | } | 44 | } |
| 70 | 45 | ||
| 71 | #define smp_vcpu_scheduled (1) | 46 | static inline int smp_find_processor_id(int address) { return 0; } |
| 47 | static inline int smp_vcpu_scheduled(int cpu) { return 1; } | ||
| 48 | static inline void smp_yield_cpu(int cpu) { } | ||
| 49 | static inline void smp_yield(void) { } | ||
| 50 | static inline void smp_stop_cpu(void) { } | ||
| 72 | 51 | ||
| 73 | #endif /* CONFIG_SMP */ | 52 | #endif /* CONFIG_SMP */ |
| 74 | 53 | ||
| 75 | #ifdef CONFIG_HOTPLUG_CPU | 54 | #ifdef CONFIG_HOTPLUG_CPU |
| 76 | extern int smp_rescan_cpus(void); | 55 | extern int smp_rescan_cpus(void); |
| 77 | extern void __noreturn cpu_die(void); | 56 | extern void __noreturn cpu_die(void); |
| 57 | extern void __cpu_die(unsigned int cpu); | ||
| 58 | extern int __cpu_disable(void); | ||
| 78 | #else | 59 | #else |
| 79 | static inline int smp_rescan_cpus(void) { return 0; } | 60 | static inline int smp_rescan_cpus(void) { return 0; } |
| 80 | static inline void cpu_die(void) { } | 61 | static inline void cpu_die(void) { } |
diff --git a/arch/s390/include/asm/system.h b/arch/s390/include/asm/system.h index d73cc6b60000..2e0bb7f0f9b2 100644 --- a/arch/s390/include/asm/system.h +++ b/arch/s390/include/asm/system.h | |||
| @@ -7,8 +7,10 @@ | |||
| 7 | #ifndef __ASM_SYSTEM_H | 7 | #ifndef __ASM_SYSTEM_H |
| 8 | #define __ASM_SYSTEM_H | 8 | #define __ASM_SYSTEM_H |
| 9 | 9 | ||
| 10 | #include <linux/preempt.h> | ||
| 10 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
| 11 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
| 13 | #include <linux/string.h> | ||
| 12 | #include <asm/types.h> | 14 | #include <asm/types.h> |
| 13 | #include <asm/ptrace.h> | 15 | #include <asm/ptrace.h> |
| 14 | #include <asm/setup.h> | 16 | #include <asm/setup.h> |
| @@ -248,6 +250,38 @@ static inline int test_facility(unsigned long nr) | |||
| 248 | return (*ptr & (0x80 >> (nr & 7))) != 0; | 250 | return (*ptr & (0x80 >> (nr & 7))) != 0; |
| 249 | } | 251 | } |
| 250 | 252 | ||
| 253 | /** | ||
| 254 | * stfle - Store facility list extended | ||
| 255 | * @stfle_fac_list: array where facility list can be stored | ||
| 256 | * @size: size of passed in array in double words | ||
| 257 | */ | ||
| 258 | static inline void stfle(u64 *stfle_fac_list, int size) | ||
| 259 | { | ||
| 260 | unsigned long nr; | ||
| 261 | |||
| 262 | preempt_disable(); | ||
| 263 | S390_lowcore.stfl_fac_list = 0; | ||
| 264 | asm volatile( | ||
| 265 | " .insn s,0xb2b10000,0(0)\n" /* stfl */ | ||
| 266 | "0:\n" | ||
| 267 | EX_TABLE(0b, 0b) | ||
| 268 | : "=m" (S390_lowcore.stfl_fac_list)); | ||
| 269 | nr = 4; /* bytes stored by stfl */ | ||
| 270 | memcpy(stfle_fac_list, &S390_lowcore.stfl_fac_list, 4); | ||
| 271 | if (S390_lowcore.stfl_fac_list & 0x01000000) { | ||
| 272 | /* More facility bits available with stfle */ | ||
| 273 | register unsigned long reg0 asm("0") = size - 1; | ||
| 274 | |||
| 275 | asm volatile(".insn s,0xb2b00000,0(%1)" /* stfle */ | ||
| 276 | : "+d" (reg0) | ||
| 277 | : "a" (stfle_fac_list) | ||
| 278 | : "memory", "cc"); | ||
| 279 | nr = (reg0 + 1) * 8; /* # bytes stored by stfle */ | ||
| 280 | } | ||
| 281 | memset((char *) stfle_fac_list + nr, 0, size * 8 - nr); | ||
| 282 | preempt_enable(); | ||
| 283 | } | ||
| 284 | |||
| 251 | static inline unsigned short stap(void) | 285 | static inline unsigned short stap(void) |
| 252 | { | 286 | { |
| 253 | unsigned short cpu_address; | 287 | unsigned short cpu_address; |
diff --git a/arch/s390/include/asm/timer.h b/arch/s390/include/asm/timer.h index 814243cafdfe..e63069ba39e3 100644 --- a/arch/s390/include/asm/timer.h +++ b/arch/s390/include/asm/timer.h | |||
| @@ -33,8 +33,8 @@ struct vtimer_queue { | |||
| 33 | spinlock_t lock; | 33 | spinlock_t lock; |
| 34 | __u64 timer; /* last programmed timer */ | 34 | __u64 timer; /* last programmed timer */ |
| 35 | __u64 elapsed; /* elapsed time of timer expire values */ | 35 | __u64 elapsed; /* elapsed time of timer expire values */ |
| 36 | __u64 idle; /* temp var for idle */ | 36 | __u64 idle_enter; /* cpu timer on idle enter */ |
| 37 | int do_spt; /* =1: reprogram cpu timer in idle */ | 37 | __u64 idle_exit; /* cpu timer on idle exit */ |
| 38 | }; | 38 | }; |
| 39 | 39 | ||
| 40 | extern void init_virt_timer(struct vtimer_list *timer); | 40 | extern void init_virt_timer(struct vtimer_list *timer); |
diff --git a/arch/s390/include/asm/vdso.h b/arch/s390/include/asm/vdso.h index 533f35751aeb..c4a11cfad3c8 100644 --- a/arch/s390/include/asm/vdso.h +++ b/arch/s390/include/asm/vdso.h | |||
| @@ -40,8 +40,8 @@ struct vdso_per_cpu_data { | |||
| 40 | extern struct vdso_data *vdso_data; | 40 | extern struct vdso_data *vdso_data; |
| 41 | 41 | ||
| 42 | #ifdef CONFIG_64BIT | 42 | #ifdef CONFIG_64BIT |
| 43 | int vdso_alloc_per_cpu(int cpu, struct _lowcore *lowcore); | 43 | int vdso_alloc_per_cpu(struct _lowcore *lowcore); |
| 44 | void vdso_free_per_cpu(int cpu, struct _lowcore *lowcore); | 44 | void vdso_free_per_cpu(struct _lowcore *lowcore); |
| 45 | #endif | 45 | #endif |
| 46 | 46 | ||
| 47 | #endif /* __ASSEMBLY__ */ | 47 | #endif /* __ASSEMBLY__ */ |
