aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/dis.c
diff options
context:
space:
mode:
authorJan Glauber <jang@linux.vnet.ibm.com>2012-07-31 04:52:05 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2012-09-26 09:45:02 -0400
commite4b8b3f33fcaa0ed6e6b5482a606091d8cd20beb (patch)
tree7f1e47eafd75cb11bed5b91c2c13813eb6204fc8 /arch/s390/kernel/dis.c
parent0d804b20735d974534abb422f723d404b779433a (diff)
s390: add support for runtime instrumentation
Allow user-space threads to use runtime instrumentation (RI). To enable RI for a thread there is a new s390 specific system call, sys_s390_runtime_instr, that takes as parameter a realtime signal number. If the RI facility is available the system call sets up a control block for the calling thread with the appropriate permissions for the thread to modify the control block. The user-space thread can then use the store and modify RI instructions to alter the control block and start/stop the instrumentation via RION/RIOFF. If the user specified program buffer runs full RI triggers an external interrupt. The external interrupt is translated to a real-time signal that is delivered to the thread that enabled RI on that CPU. The number of the real-time signal is the number specified in the RI system call. So, user-space can select any available real-time signal number in case the application itself uses real-time signals for other purposes. The kernel saves the RI control blocks on task switch only if the running thread was enabled for RI. Therefore, the performance impact on task switch should be negligible if RI is not used. RI is only enabled for user-space mode and is disabled for the supervisor state. Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/dis.c')
-rw-r--r--arch/s390/kernel/dis.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/s390/kernel/dis.c b/arch/s390/kernel/dis.c
index 84fd7e920bfe..4bc67db63522 100644
--- a/arch/s390/kernel/dis.c
+++ b/arch/s390/kernel/dis.c
@@ -315,6 +315,8 @@ enum {
315 LONG_INSN_POPCNT, 315 LONG_INSN_POPCNT,
316 LONG_INSN_RISBHG, 316 LONG_INSN_RISBHG,
317 LONG_INSN_RISBLG, 317 LONG_INSN_RISBLG,
318 LONG_INSN_RINEXT,
319 LONG_INSN_RIEMIT,
318}; 320};
319 321
320static char *long_insn_name[] = { 322static char *long_insn_name[] = {
@@ -330,6 +332,8 @@ static char *long_insn_name[] = {
330 [LONG_INSN_POPCNT] = "popcnt", 332 [LONG_INSN_POPCNT] = "popcnt",
331 [LONG_INSN_RISBHG] = "risbhg", 333 [LONG_INSN_RISBHG] = "risbhg",
332 [LONG_INSN_RISBLG] = "risblk", 334 [LONG_INSN_RISBLG] = "risblk",
335 [LONG_INSN_RINEXT] = "rinext",
336 [LONG_INSN_RIEMIT] = "riemit",
333}; 337};
334 338
335static struct insn opcode[] = { 339static struct insn opcode[] = {
@@ -582,6 +586,17 @@ static struct insn opcode_a7[] = {
582 { "", 0, INSTR_INVALID } 586 { "", 0, INSTR_INVALID }
583}; 587};
584 588
589static struct insn opcode_aa[] = {
590#ifdef CONFIG_64BIT
591 { { 0, LONG_INSN_RINEXT }, 0x00, INSTR_RI_RI },
592 { "rion", 0x01, INSTR_RI_RI },
593 { "tric", 0x02, INSTR_RI_RI },
594 { "rioff", 0x03, INSTR_RI_RI },
595 { { 0, LONG_INSN_RIEMIT }, 0x04, INSTR_RI_RI },
596#endif
597 { "", 0, INSTR_INVALID }
598};
599
585static struct insn opcode_b2[] = { 600static struct insn opcode_b2[] = {
586#ifdef CONFIG_64BIT 601#ifdef CONFIG_64BIT
587 { "sske", 0x2b, INSTR_RRF_M0RR }, 602 { "sske", 0x2b, INSTR_RRF_M0RR },
@@ -1210,6 +1225,9 @@ static struct insn opcode_eb[] = {
1210 { "cliy", 0x55, INSTR_SIY_URD }, 1225 { "cliy", 0x55, INSTR_SIY_URD },
1211 { "oiy", 0x56, INSTR_SIY_URD }, 1226 { "oiy", 0x56, INSTR_SIY_URD },
1212 { "xiy", 0x57, INSTR_SIY_URD }, 1227 { "xiy", 0x57, INSTR_SIY_URD },
1228 { "lric", 0x60, INSTR_RSY_RDRM },
1229 { "stric", 0x61, INSTR_RSY_RDRM },
1230 { "mric", 0x62, INSTR_RSY_RDRM },
1213 { "icmh", 0x80, INSTR_RSE_RURD }, 1231 { "icmh", 0x80, INSTR_RSE_RURD },
1214 { "icmh", 0x80, INSTR_RSY_RURD }, 1232 { "icmh", 0x80, INSTR_RSY_RURD },
1215 { "icmy", 0x81, INSTR_RSY_RURD }, 1233 { "icmy", 0x81, INSTR_RSY_RURD },
@@ -1408,6 +1426,9 @@ static struct insn *find_insn(unsigned char *code)
1408 case 0xa7: 1426 case 0xa7:
1409 table = opcode_a7; 1427 table = opcode_a7;
1410 break; 1428 break;
1429 case 0xaa:
1430 table = opcode_aa;
1431 break;
1411 case 0xb2: 1432 case 0xb2:
1412 table = opcode_b2; 1433 table = opcode_b2;
1413 break; 1434 break;