]> git.baikalelectronics.ru Git - kernel.git/commitdiff
s390: add struct tpi_info to struct pt_regs
authorSven Schnelle <svens@linux.ibm.com>
Mon, 10 May 2021 19:10:16 +0000 (21:10 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Mon, 7 Jun 2021 15:07:01 +0000 (17:07 +0200)
To avoid casting ptrace members, add a union containing
both struct tpi_info and explicit int_code/int_parm members.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/include/asm/ptrace.h
arch/s390/include/asm/tpi.h
arch/s390/include/uapi/asm/schid.h
drivers/s390/cio/airq.c
drivers/s390/cio/cio.c

index f828be78937f1060df9076a3c3bae0bda58d0477..c7850d649373f2ecc85a288c53e8f8391a4a432d 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <linux/bits.h>
 #include <uapi/asm/ptrace.h>
+#include <asm/tpi.h>
 
 #define PIF_SYSCALL            0       /* inside a system call */
 #define PIF_SYSCALL_RESTART    1       /* restart the current system call */
@@ -86,9 +87,14 @@ struct pt_regs
                };
        };
        unsigned long orig_gpr2;
-       unsigned int int_code;
-       unsigned int int_parm;
-       unsigned long int_parm_long;
+       union {
+               struct {
+                       unsigned int int_code;
+                       unsigned int int_parm;
+                       unsigned long int_parm_long;
+               };
+               struct tpi_info tpi_info;
+       };
        unsigned long flags;
        unsigned long cr1;
 };
index f88911180b027a1ba90f5a910466832e37851273..1ac538b8cbf5529333f671d55b6f7f30c7f526a0 100644 (file)
@@ -5,6 +5,8 @@
 #include <linux/types.h>
 #include <uapi/asm/schid.h>
 
+#ifndef __ASSEMBLY__
+
 /* I/O-Interruption Code as stored by TEST PENDING INTERRUPTION (TPI). */
 struct tpi_info {
        struct subchannel_id schid;
@@ -17,4 +19,6 @@ struct tpi_info {
        u32 :12;
 } __packed __aligned(4);
 
+#endif /* __ASSEMBLY__ */
+
 #endif /* _ASM_S390_TPI_H */
index 58fca6f4841016dc3b3e16041988ecf6353efde7..a3e1cf16855348b5839200062df8ee05eae53468 100644 (file)
@@ -4,6 +4,8 @@
 
 #include <linux/types.h>
 
+#ifndef __ASSEMBLY__
+
 struct subchannel_id {
        __u32 cssid : 8;
        __u32 : 4;
@@ -13,5 +15,6 @@ struct subchannel_id {
        __u32 sch_no : 16;
 } __attribute__ ((packed, aligned(4)));
 
+#endif /* __ASSEMBLY__ */
 
 #endif /* _UAPIASM_SCHID_H */
index cb466ed7eb5ef1d718dfc256829cd603871d7409..e56535c99888fa73f54533c6ffe71ae4c3ea0ca9 100644 (file)
@@ -93,7 +93,7 @@ static irqreturn_t do_airq_interrupt(int irq, void *dummy)
        struct hlist_head *head;
 
        set_cpu_flag(CIF_NOHZ_DELAY);
-       tpi_info = (struct tpi_info *) &get_irq_regs()->int_code;
+       tpi_info = &get_irq_regs()->tpi_info;
        trace_s390_cio_adapter_int(tpi_info);
        head = &airq_lists[tpi_info->isc];
        rcu_read_lock();
index 6d716db2a46abb15b59b28fcde4363b4ebb771e8..923f5ca4f5e6b6584b902c42fc5984956ab56589 100644 (file)
@@ -536,7 +536,7 @@ static irqreturn_t do_cio_interrupt(int irq, void *dummy)
        struct irb *irb;
 
        set_cpu_flag(CIF_NOHZ_DELAY);
-       tpi_info = (struct tpi_info *) &get_irq_regs()->int_code;
+       tpi_info = &get_irq_regs()->tpi_info;
        trace_s390_cio_interrupt(tpi_info);
        irb = this_cpu_ptr(&cio_irb);
        sch = (struct subchannel *)(unsigned long) tpi_info->intparm;