diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2015-11-02 08:03:46 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2015-11-03 08:40:51 -0500 |
commit | b38feccd663b55ab07116208b68e1ffc7c3c7e78 (patch) | |
tree | 907f442de0e3dd45109899915d6849f3fd4f5d4b | |
parent | e510f681d27d402d74dc7b81e13db118e4180937 (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>
-rw-r--r-- | arch/s390/include/asm/cpu_mf.h | 5 | ||||
-rw-r--r-- | arch/s390/include/asm/irq.h | 1 | ||||
-rw-r--r-- | arch/s390/include/asm/processor.h | 1 | ||||
-rw-r--r-- | arch/s390/kernel/irq.c | 1 | ||||
-rw-r--r-- | arch/s390/kernel/process.c | 1 | ||||
-rw-r--r-- | arch/s390/kernel/runtime_instr.c | 64 |
6 files changed, 3 insertions, 70 deletions
diff --git a/arch/s390/include/asm/cpu_mf.h b/arch/s390/include/asm/cpu_mf.h index 5243a8679a1d..9dd04b9e9782 100644 --- a/arch/s390/include/asm/cpu_mf.h +++ b/arch/s390/include/asm/cpu_mf.h | |||
@@ -22,15 +22,10 @@ | |||
22 | #define CPU_MF_INT_SF_LSDA (1 << 22) /* loss of sample data alert */ | 22 | #define CPU_MF_INT_SF_LSDA (1 << 22) /* loss of sample data alert */ |
23 | #define CPU_MF_INT_CF_CACA (1 << 7) /* counter auth. change alert */ | 23 | #define CPU_MF_INT_CF_CACA (1 << 7) /* counter auth. change alert */ |
24 | #define CPU_MF_INT_CF_LCDA (1 << 6) /* loss of counter data alert */ | 24 | #define CPU_MF_INT_CF_LCDA (1 << 6) /* loss of counter data alert */ |
25 | #define CPU_MF_INT_RI_HALTED (1 << 5) /* run-time instr. halted */ | ||
26 | #define CPU_MF_INT_RI_BUF_FULL (1 << 4) /* run-time instr. program | ||
27 | buffer full */ | ||
28 | |||
29 | #define CPU_MF_INT_CF_MASK (CPU_MF_INT_CF_CACA|CPU_MF_INT_CF_LCDA) | 25 | #define CPU_MF_INT_CF_MASK (CPU_MF_INT_CF_CACA|CPU_MF_INT_CF_LCDA) |
30 | #define CPU_MF_INT_SF_MASK (CPU_MF_INT_SF_IAE|CPU_MF_INT_SF_ISE| \ | 26 | #define CPU_MF_INT_SF_MASK (CPU_MF_INT_SF_IAE|CPU_MF_INT_SF_ISE| \ |
31 | CPU_MF_INT_SF_PRA|CPU_MF_INT_SF_SACA| \ | 27 | CPU_MF_INT_SF_PRA|CPU_MF_INT_SF_SACA| \ |
32 | CPU_MF_INT_SF_LSDA) | 28 | CPU_MF_INT_SF_LSDA) |
33 | #define CPU_MF_INT_RI_MASK (CPU_MF_INT_RI_HALTED|CPU_MF_INT_RI_BUF_FULL) | ||
34 | 29 | ||
35 | /* CPU measurement facility support */ | 30 | /* CPU measurement facility support */ |
36 | static inline int cpum_cf_avail(void) | 31 | static inline int cpum_cf_avail(void) |
diff --git a/arch/s390/include/asm/irq.h b/arch/s390/include/asm/irq.h index 33d26424c2f5..f97b055de76a 100644 --- a/arch/s390/include/asm/irq.h +++ b/arch/s390/include/asm/irq.h | |||
@@ -47,7 +47,6 @@ enum interruption_class { | |||
47 | IRQEXT_IUC, | 47 | IRQEXT_IUC, |
48 | IRQEXT_CMS, | 48 | IRQEXT_CMS, |
49 | IRQEXT_CMC, | 49 | IRQEXT_CMC, |
50 | IRQEXT_CMR, | ||
51 | IRQEXT_FTP, | 50 | IRQEXT_FTP, |
52 | IRQIO_CIO, | 51 | IRQIO_CIO, |
53 | IRQIO_QAI, | 52 | IRQIO_QAI, |
diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h index d39cca3a3153..b16c3d0a1b9f 100644 --- a/arch/s390/include/asm/processor.h +++ b/arch/s390/include/asm/processor.h | |||
@@ -107,7 +107,6 @@ struct thread_struct { | |||
107 | struct list_head list; | 107 | struct list_head list; |
108 | /* cpu runtime instrumentation */ | 108 | /* cpu runtime instrumentation */ |
109 | struct runtime_instr_cb *ri_cb; | 109 | struct runtime_instr_cb *ri_cb; |
110 | int ri_signum; | ||
111 | unsigned char trap_tdb[256]; /* Transaction abort diagnose block */ | 110 | unsigned char trap_tdb[256]; /* Transaction abort diagnose block */ |
112 | }; | 111 | }; |
113 | 112 | ||
diff --git a/arch/s390/kernel/irq.c b/arch/s390/kernel/irq.c index e9d9addfaa44..f41d5208aaf7 100644 --- a/arch/s390/kernel/irq.c +++ b/arch/s390/kernel/irq.c | |||
@@ -69,7 +69,6 @@ static const struct irq_class irqclass_sub_desc[] = { | |||
69 | {.irq = IRQEXT_IUC, .name = "IUC", .desc = "[EXT] IUCV"}, | 69 | {.irq = IRQEXT_IUC, .name = "IUC", .desc = "[EXT] IUCV"}, |
70 | {.irq = IRQEXT_CMS, .name = "CMS", .desc = "[EXT] CPU-Measurement: Sampling"}, | 70 | {.irq = IRQEXT_CMS, .name = "CMS", .desc = "[EXT] CPU-Measurement: Sampling"}, |
71 | {.irq = IRQEXT_CMC, .name = "CMC", .desc = "[EXT] CPU-Measurement: Counter"}, | 71 | {.irq = IRQEXT_CMC, .name = "CMC", .desc = "[EXT] CPU-Measurement: Counter"}, |
72 | {.irq = IRQEXT_CMR, .name = "CMR", .desc = "[EXT] CPU-Measurement: RI"}, | ||
73 | {.irq = IRQEXT_FTP, .name = "FTP", .desc = "[EXT] HMC FTP Service"}, | 72 | {.irq = IRQEXT_FTP, .name = "FTP", .desc = "[EXT] HMC FTP Service"}, |
74 | {.irq = IRQIO_CIO, .name = "CIO", .desc = "[I/O] Common I/O Layer Interrupt"}, | 73 | {.irq = IRQIO_CIO, .name = "CIO", .desc = "[I/O] Common I/O Layer Interrupt"}, |
75 | {.irq = IRQIO_QAI, .name = "QAI", .desc = "[I/O] QDIO Adapter Interrupt"}, | 74 | {.irq = IRQIO_QAI, .name = "QAI", .desc = "[I/O] QDIO Adapter Interrupt"}, |
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index cd5568608744..688a3aad9c79 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c | |||
@@ -171,7 +171,6 @@ int copy_thread(unsigned long clone_flags, unsigned long new_stackp, | |||
171 | 171 | ||
172 | /* Don't copy runtime instrumentation info */ | 172 | /* Don't copy runtime instrumentation info */ |
173 | p->thread.ri_cb = NULL; | 173 | p->thread.ri_cb = NULL; |
174 | p->thread.ri_signum = 0; | ||
175 | frame->childregs.psw.mask &= ~PSW_MASK_RI; | 174 | frame->childregs.psw.mask &= ~PSW_MASK_RI; |
176 | 175 | ||
177 | /* Set a new TLS ? */ | 176 | /* Set a new TLS ? */ |
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 */ |
19 | struct runtime_instr_cb runtime_instr_empty_cb; | 19 | struct runtime_instr_cb runtime_instr_empty_cb; |
20 | 20 | ||
21 | static int runtime_instr_avail(void) | ||
22 | { | ||
23 | return test_facility(64); | ||
24 | } | ||
25 | |||
26 | static void disable_runtime_instr(void) | 21 | static 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) | |||
40 | static void init_runtime_instr_cb(struct runtime_instr_cb *cb) | 35 | static 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 | ||
64 | static void runtime_instr_int_handler(struct ext_code ext_code, | 57 | SYSCALL_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 | |||
95 | SYSCALL_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 | |||
133 | static 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 | } | ||
149 | device_initcall(runtime_instr_init); | ||