aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/runtime_instr.c
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2015-11-02 08:03:46 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2015-11-03 08:40:51 -0500
commitb38feccd663b55ab07116208b68e1ffc7c3c7e78 (patch)
tree907f442de0e3dd45109899915d6849f3fd4f5d4b /arch/s390/kernel/runtime_instr.c
parente510f681d27d402d74dc7b81e13db118e4180937 (diff)
s390: remove runtime instrumentation interrupts
The external interrupts for runtime instrumentation buffer-full and runtime instrumentation halted are unused and have no current user. Remove the support and ignore the second parameter of the s390_runtime_instr system call from now on. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/runtime_instr.c')
-rw-r--r--arch/s390/kernel/runtime_instr.c64
1 files changed, 3 insertions, 61 deletions
diff --git a/arch/s390/kernel/runtime_instr.c b/arch/s390/kernel/runtime_instr.c
index 26b4ae96fdd7..fffa0e5462af 100644
--- a/arch/s390/kernel/runtime_instr.c
+++ b/arch/s390/kernel/runtime_instr.c
@@ -18,11 +18,6 @@
18/* empty control block to disable RI by loading it */ 18/* empty control block to disable RI by loading it */
19struct runtime_instr_cb runtime_instr_empty_cb; 19struct runtime_instr_cb runtime_instr_empty_cb;
20 20
21static int runtime_instr_avail(void)
22{
23 return test_facility(64);
24}
25
26static void disable_runtime_instr(void) 21static void disable_runtime_instr(void)
27{ 22{
28 struct pt_regs *regs = task_pt_regs(current); 23 struct pt_regs *regs = task_pt_regs(current);
@@ -40,7 +35,6 @@ static void disable_runtime_instr(void)
40static void init_runtime_instr_cb(struct runtime_instr_cb *cb) 35static void init_runtime_instr_cb(struct runtime_instr_cb *cb)
41{ 36{
42 cb->buf_limit = 0xfff; 37 cb->buf_limit = 0xfff;
43 cb->int_requested = 1;
44 cb->pstate = 1; 38 cb->pstate = 1;
45 cb->pstate_set_buf = 1; 39 cb->pstate_set_buf = 1;
46 cb->pstate_sample = 1; 40 cb->pstate_sample = 1;
@@ -57,46 +51,14 @@ void exit_thread_runtime_instr(void)
57 return; 51 return;
58 disable_runtime_instr(); 52 disable_runtime_instr();
59 kfree(task->thread.ri_cb); 53 kfree(task->thread.ri_cb);
60 task->thread.ri_signum = 0;
61 task->thread.ri_cb = NULL; 54 task->thread.ri_cb = NULL;
62} 55}
63 56
64static void runtime_instr_int_handler(struct ext_code ext_code, 57SYSCALL_DEFINE1(s390_runtime_instr, int, command)
65 unsigned int param32, unsigned long param64)
66{
67 struct siginfo info;
68
69 if (!(param32 & CPU_MF_INT_RI_MASK))
70 return;
71
72 inc_irq_stat(IRQEXT_CMR);
73
74 if (!current->thread.ri_cb)
75 return;
76 if (current->thread.ri_signum < SIGRTMIN ||
77 current->thread.ri_signum > SIGRTMAX) {
78 WARN_ON_ONCE(1);
79 return;
80 }
81
82 memset(&info, 0, sizeof(info));
83 info.si_signo = current->thread.ri_signum;
84 info.si_code = SI_QUEUE;
85 if (param32 & CPU_MF_INT_RI_BUF_FULL)
86 info.si_int = ENOBUFS;
87 else if (param32 & CPU_MF_INT_RI_HALTED)
88 info.si_int = ECANCELED;
89 else
90 return; /* unknown reason */
91
92 send_sig_info(current->thread.ri_signum, &info, current);
93}
94
95SYSCALL_DEFINE2(s390_runtime_instr, int, command, int, signum)
96{ 58{
97 struct runtime_instr_cb *cb; 59 struct runtime_instr_cb *cb;
98 60
99 if (!runtime_instr_avail()) 61 if (!test_facility(64))
100 return -EOPNOTSUPP; 62 return -EOPNOTSUPP;
101 63
102 if (command == S390_RUNTIME_INSTR_STOP) { 64 if (command == S390_RUNTIME_INSTR_STOP) {
@@ -106,8 +68,7 @@ SYSCALL_DEFINE2(s390_runtime_instr, int, command, int, signum)
106 return 0; 68 return 0;
107 } 69 }
108 70
109 if (command != S390_RUNTIME_INSTR_START || 71 if (command != S390_RUNTIME_INSTR_START)
110 (signum < SIGRTMIN || signum > SIGRTMAX))
111 return -EINVAL; 72 return -EINVAL;
112 73
113 if (!current->thread.ri_cb) { 74 if (!current->thread.ri_cb) {
@@ -120,7 +81,6 @@ SYSCALL_DEFINE2(s390_runtime_instr, int, command, int, signum)
120 } 81 }
121 82
122 init_runtime_instr_cb(cb); 83 init_runtime_instr_cb(cb);
123 current->thread.ri_signum = signum;
124 84
125 /* now load the control block to make it available */ 85 /* now load the control block to make it available */
126 preempt_disable(); 86 preempt_disable();
@@ -129,21 +89,3 @@ SYSCALL_DEFINE2(s390_runtime_instr, int, command, int, signum)
129 preempt_enable(); 89 preempt_enable();
130 return 0; 90 return 0;
131} 91}
132
133static int __init runtime_instr_init(void)
134{
135 int rc;
136
137 if (!runtime_instr_avail())
138 return 0;
139
140 irq_subclass_register(IRQ_SUBCLASS_MEASUREMENT_ALERT);
141 rc = register_external_irq(EXT_IRQ_MEASURE_ALERT,
142 runtime_instr_int_handler);
143 if (rc)
144 irq_subclass_unregister(IRQ_SUBCLASS_MEASUREMENT_ALERT);
145 else
146 pr_info("Runtime instrumentation facility initialized\n");
147 return rc;
148}
149device_initcall(runtime_instr_init);