aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include
diff options
context:
space:
mode:
authorMichael Holzheu <holzheu@linux.vnet.ibm.com>2012-03-11 11:59:32 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2012-03-11 11:59:29 -0400
commit3ab121ab18669226742891416fe7ecc86dadb047 (patch)
tree328ef8f1e23da33a475ce4e20c0d0490a2e63e76 /arch/s390/include
parentfde15c3a3adc7b65cd0610dd6bca4804ee7ffd38 (diff)
[S390] kernel: Add z/VM LGR detection
Currently the following mechanisms are available to move active Linux on System z instances between machines: * z/VM 6.2 SSI (Single System Image) * Suspend/resume For moving Linux instances in this patch the term LGR (Linux Guest Relocation) is used. Because such an operation is critical, it should be detectable from Linux. With this patch for both, a live system and a kernel dump, the information about LGRs is accessible. To identify a guest, stsi and stfle data is used. A new function lgr_info_log() compares the current data (lgr_info_cur) with the last recorded one (lgr_info_last). In case the two data sets differ, lgr_info_cur is logged to the "lgr" s390dbf. The following trigger points call lgr_info_log(): * panic * die * kdump * LGR timer * PSW restart * QDIO recovery * resume This patch also changes the s390dbf hex_ascii view. Now only printable ASCII characters are shown. Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/include')
-rw-r--r--arch/s390/include/asm/debug.h1
-rw-r--r--arch/s390/include/asm/ipl.h1
-rw-r--r--arch/s390/include/asm/system.h34
3 files changed, 36 insertions, 0 deletions
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
132void debug_set_level(debug_info_t* id, int new_level); 132void debug_set_level(debug_info_t* id, int new_level);
133 133
134void debug_set_critical(void);
134void debug_stop_all(void); 135void debug_stop_all(void);
135 136
136static inline debug_entry_t* 137static inline debug_entry_t*
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 {
169extern int diag308(unsigned long subcode, void *addr); 169extern int diag308(unsigned long subcode, void *addr);
170extern void diag308_reset(void); 170extern void diag308_reset(void);
171extern void store_status(void); 171extern void store_status(void);
172extern 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/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 */
258static 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
251static inline unsigned short stap(void) 285static inline unsigned short stap(void)
252{ 286{
253 unsigned short cpu_address; 287 unsigned short cpu_address;