s390: add HWCAP_S390_PCI_MIO to ELF hwcaps
authorNiklas Schnelle <schnelle@linux.ibm.com>
Thu, 8 Jul 2021 13:43:13 +0000 (15:43 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Tue, 27 Jul 2021 07:39:19 +0000 (09:39 +0200)
In order to support the use of enhanced PCI instructions in both kernel-
and userspace we need both hardware support and proper setup in the
kernel. The latter can be toggled off with the pci=nomio command line
option.

Thus availability of this feature in userspace depends on all of kernel
configuration (CONFIG_PCI), hardware support and the current kernel
command line and can thus not rely solely on a facility bit. Instead
let's introduce a new ELF hardware capability bit HWCAP_S390_PCI_MIO to
tell userspace whether these PCI instructions can be used.

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/include/asm/elf.h
arch/s390/kernel/processor.c
arch/s390/kernel/setup.c

index 6e55e4a..0291d45 100644 (file)
 #define HWCAP_S390_DFLT                262144
 #define HWCAP_S390_VXRS_PDE2   524288
 #define HWCAP_S390_NNPA                1048576
+#define HWCAP_S390_PCI_MIO     2097152
 
 /* Internal bits, not exposed via elf */
 #define HWCAP_INT_SIE          1UL
index 9cd63ef..e6c297e 100644 (file)
@@ -115,7 +115,7 @@ static void show_cpu_summary(struct seq_file *m, void *v)
        static const char *hwcap_str[] = {
                "esan3", "zarch", "stfle", "msa", "ldisp", "eimm", "dfp",
                "edat", "etf3eh", "highgprs", "te", "vx", "vxd", "vxe", "gs",
-               "vxe2", "vxp", "sort", "dflt", "vxp2", "nnpa"
+               "vxe2", "vxp", "sort", "dflt", "vxp2", "nnpa", "pcimio"
        };
        static const char * const int_hwcap_str[] = {
                "sie"
index 32ce8d4..1c0ab30 100644 (file)
@@ -964,6 +964,8 @@ static int __init setup_hwcaps(void)
         */
        if (MACHINE_HAS_GS)
                elf_hwcap |= HWCAP_S390_GS;
+       if (MACHINE_HAS_PCI_MIO)
+               elf_hwcap |= HWCAP_S390_PCI_MIO;
 
        get_cpu_id(&cpu_id);
        add_device_randomness(&cpu_id, sizeof(cpu_id));