s390: enable processes for mio instructions
authorSebastian Ott <sebott@linux.ibm.com>
Tue, 23 Apr 2019 11:14:28 +0000 (13:14 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Mon, 29 Apr 2019 08:47:01 +0000 (10:47 +0200)
Allow for userspace to use PCI MIO instructions.

Signed-off-by: Sebastian Ott <sebott@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/pci_insn.h
arch/s390/kernel/early.c

index 61cf953..ff81ed1 100644 (file)
@@ -143,4 +143,14 @@ static inline int zpci_set_irq_ctrl(u16 ctl, u8 isc)
        return __zpci_set_irq_ctrl(ctl, isc, &iib);
 }
 
+#ifdef CONFIG_PCI
+static inline void enable_mio_ctl(void)
+{
+       if (static_branch_likely(&have_mio))
+               __ctl_set_bit(2, 5);
+}
+#else /* CONFIG_PCI */
+static inline void enable_mio_ctl(void) {}
+#endif /* CONFIG_PCI */
+
 #endif
index c196abd..ab09ada 100644 (file)
@@ -30,6 +30,7 @@
 #include <asm/sclp.h>
 #include <asm/facility.h>
 #include <asm/boot_data.h>
+#include <asm/pci_insn.h>
 #include "entry.h"
 
 /*
@@ -235,6 +236,7 @@ static __init void detect_machine_facilities(void)
                clock_comparator_max = -1ULL >> 1;
                __ctl_set_bit(0, 53);
        }
+       enable_mio_ctl();
 }
 
 static inline void save_vector_registers(void)