s390: remove runtime instrumentation interrupts
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 2 Nov 2015 13:03:46 +0000 (14:03 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 3 Nov 2015 13:40:51 +0000 (14:40 +0100)
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>
arch/s390/include/asm/cpu_mf.h
arch/s390/include/asm/irq.h
arch/s390/include/asm/processor.h
arch/s390/kernel/irq.c
arch/s390/kernel/process.c
arch/s390/kernel/runtime_instr.c

index 5243a8679a1dcb7cc69037714fabba64c652dcf1..9dd04b9e9782128135cfe9aa847a0e66b85812f7 100644 (file)
 #define CPU_MF_INT_SF_LSDA     (1 << 22)       /* loss of sample data alert */
 #define CPU_MF_INT_CF_CACA     (1 <<  7)       /* counter auth. change alert */
 #define CPU_MF_INT_CF_LCDA     (1 <<  6)       /* loss of counter data alert */
-#define CPU_MF_INT_RI_HALTED   (1 <<  5)       /* run-time instr. halted */
-#define CPU_MF_INT_RI_BUF_FULL (1 <<  4)       /* run-time instr. program
-                                                  buffer full */
-
 #define CPU_MF_INT_CF_MASK     (CPU_MF_INT_CF_CACA|CPU_MF_INT_CF_LCDA)
 #define CPU_MF_INT_SF_MASK     (CPU_MF_INT_SF_IAE|CPU_MF_INT_SF_ISE|   \
                                 CPU_MF_INT_SF_PRA|CPU_MF_INT_SF_SACA|  \
                                 CPU_MF_INT_SF_LSDA)
-#define CPU_MF_INT_RI_MASK     (CPU_MF_INT_RI_HALTED|CPU_MF_INT_RI_BUF_FULL)
 
 /* CPU measurement facility support */
 static inline int cpum_cf_avail(void)
index 33d26424c2f5af471a1dc2ccf52284c5b4c506f2..f97b055de76a9f24248e1ee738deeb5c2ddb8494 100644 (file)
@@ -47,7 +47,6 @@ enum interruption_class {
        IRQEXT_IUC,
        IRQEXT_CMS,
        IRQEXT_CMC,
-       IRQEXT_CMR,
        IRQEXT_FTP,
        IRQIO_CIO,
        IRQIO_QAI,
index d39cca3a31535b3101848f8cc0d8ffecb3fce797..b16c3d0a1b9fc180bee2846ba5e057bd6cd40983 100644 (file)
@@ -107,7 +107,6 @@ struct thread_struct {
        struct list_head list;
        /* cpu runtime instrumentation */
        struct runtime_instr_cb *ri_cb;
-       int ri_signum;
        unsigned char trap_tdb[256];    /* Transaction abort diagnose block */
 };
 
index e9d9addfaa44742743905c95b64f309430bdf344..f41d5208aaf768bc7657a2e44e06f9f2b7e32f2b 100644 (file)
@@ -69,7 +69,6 @@ static const struct irq_class irqclass_sub_desc[] = {
        {.irq = IRQEXT_IUC, .name = "IUC", .desc = "[EXT] IUCV"},
        {.irq = IRQEXT_CMS, .name = "CMS", .desc = "[EXT] CPU-Measurement: Sampling"},
        {.irq = IRQEXT_CMC, .name = "CMC", .desc = "[EXT] CPU-Measurement: Counter"},
-       {.irq = IRQEXT_CMR, .name = "CMR", .desc = "[EXT] CPU-Measurement: RI"},
        {.irq = IRQEXT_FTP, .name = "FTP", .desc = "[EXT] HMC FTP Service"},
        {.irq = IRQIO_CIO,  .name = "CIO", .desc = "[I/O] Common I/O Layer Interrupt"},
        {.irq = IRQIO_QAI,  .name = "QAI", .desc = "[I/O] QDIO Adapter Interrupt"},
index cd5568608744fbe14dfd6d2a6f74684367da565f..688a3aad9c79d02a49702f729c3b418065c982e3 100644 (file)
@@ -171,7 +171,6 @@ int copy_thread(unsigned long clone_flags, unsigned long new_stackp,
 
        /* Don't copy runtime instrumentation info */
        p->thread.ri_cb = NULL;
-       p->thread.ri_signum = 0;
        frame->childregs.psw.mask &= ~PSW_MASK_RI;
 
        /* Set a new TLS ?  */
index 26b4ae96fdd731b3e5cb82d6bb23a8799e9af80f..fffa0e5462afe047c2df37b969fe8b5b9816a170 100644 (file)
 /* empty control block to disable RI by loading it */
 struct runtime_instr_cb runtime_instr_empty_cb;
 
-static int runtime_instr_avail(void)
-{
-       return test_facility(64);
-}
-
 static void disable_runtime_instr(void)
 {
        struct pt_regs *regs = task_pt_regs(current);
@@ -40,7 +35,6 @@ static void disable_runtime_instr(void)
 static void init_runtime_instr_cb(struct runtime_instr_cb *cb)
 {
        cb->buf_limit = 0xfff;
-       cb->int_requested = 1;
        cb->pstate = 1;
        cb->pstate_set_buf = 1;
        cb->pstate_sample = 1;
@@ -57,46 +51,14 @@ void exit_thread_runtime_instr(void)
                return;
        disable_runtime_instr();
        kfree(task->thread.ri_cb);
-       task->thread.ri_signum = 0;
        task->thread.ri_cb = NULL;
 }
 
-static void runtime_instr_int_handler(struct ext_code ext_code,
-                               unsigned int param32, unsigned long param64)
-{
-       struct siginfo info;
-
-       if (!(param32 & CPU_MF_INT_RI_MASK))
-               return;
-
-       inc_irq_stat(IRQEXT_CMR);
-
-       if (!current->thread.ri_cb)
-               return;
-       if (current->thread.ri_signum < SIGRTMIN ||
-           current->thread.ri_signum > SIGRTMAX) {
-               WARN_ON_ONCE(1);
-               return;
-       }
-
-       memset(&info, 0, sizeof(info));
-       info.si_signo = current->thread.ri_signum;
-       info.si_code = SI_QUEUE;
-       if (param32 & CPU_MF_INT_RI_BUF_FULL)
-               info.si_int = ENOBUFS;
-       else if (param32 & CPU_MF_INT_RI_HALTED)
-               info.si_int = ECANCELED;
-       else
-               return; /* unknown reason */
-
-       send_sig_info(current->thread.ri_signum, &info, current);
-}
-
-SYSCALL_DEFINE2(s390_runtime_instr, int, command, int, signum)
+SYSCALL_DEFINE1(s390_runtime_instr, int, command)
 {
        struct runtime_instr_cb *cb;
 
-       if (!runtime_instr_avail())
+       if (!test_facility(64))
                return -EOPNOTSUPP;
 
        if (command == S390_RUNTIME_INSTR_STOP) {
@@ -106,8 +68,7 @@ SYSCALL_DEFINE2(s390_runtime_instr, int, command, int, signum)
                return 0;
        }
 
-       if (command != S390_RUNTIME_INSTR_START ||
-           (signum < SIGRTMIN || signum > SIGRTMAX))
+       if (command != S390_RUNTIME_INSTR_START)
                return -EINVAL;
 
        if (!current->thread.ri_cb) {
@@ -120,7 +81,6 @@ SYSCALL_DEFINE2(s390_runtime_instr, int, command, int, signum)
        }
 
        init_runtime_instr_cb(cb);
-       current->thread.ri_signum = signum;
 
        /* now load the control block to make it available */
        preempt_disable();
@@ -129,21 +89,3 @@ SYSCALL_DEFINE2(s390_runtime_instr, int, command, int, signum)
        preempt_enable();
        return 0;
 }
-
-static int __init runtime_instr_init(void)
-{
-       int rc;
-
-       if (!runtime_instr_avail())
-               return 0;
-
-       irq_subclass_register(IRQ_SUBCLASS_MEASUREMENT_ALERT);
-       rc = register_external_irq(EXT_IRQ_MEASURE_ALERT,
-                                  runtime_instr_int_handler);
-       if (rc)
-               irq_subclass_unregister(IRQ_SUBCLASS_MEASUREMENT_ALERT);
-       else
-               pr_info("Runtime instrumentation facility initialized\n");
-       return rc;
-}
-device_initcall(runtime_instr_init);