]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/pci: Get rid of MACHINE_HAS_PCI_MIO
authorHeiko Carstens <hca@linux.ibm.com>
Fri, 7 Feb 2025 14:48:58 +0000 (15:48 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 4 Mar 2025 16:18:06 +0000 (17:18 +0100)
Remove MACHINE_FLAG_PCI_MIO/MACHINE_HAS_PCI_MIO and implement the identical
functionality with set_machine_feature(), clear_machine_feature() and
test_machine_feature().

Acked-by: Niklas Schnelle <schnelle@linux.ibm.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Reviewed-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/boot/startup.c
arch/s390/include/asm/machine.h
arch/s390/include/asm/setup.h
arch/s390/kernel/early.c
arch/s390/kernel/processor.c
arch/s390/pci/pci.c

index f8e6d7eb7cc2b23418a92a22356e00ea42466536..8081f06ad25877d69160422d362b186505220b0b 100644 (file)
@@ -7,6 +7,7 @@
 #include <asm/extmem.h>
 #include <asm/sections.h>
 #include <asm/maccess.h>
+#include <asm/machine.h>
 #include <asm/cpu_mf.h>
 #include <asm/setup.h>
 #include <asm/kasan.h>
@@ -57,6 +58,8 @@ static void detect_facilities(void)
                segment_noexec_mask &= ~_SEGMENT_ENTRY_NOEXEC;
                region_noexec_mask &= ~_REGION_ENTRY_NOEXEC;
        }
+       if (IS_ENABLED(CONFIG_PCI) && test_facility(153))
+               set_machine_feature(MFEATURE_PCI_MIO);
 }
 
 static int cmma_test_essa(void)
index bc30384d396d883a91eaa3c3e95bca4c1c8a1be5..488e5d64171301bb1fb4652cb691193cf979c1b6 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/const.h>
 
 #define MFEATURE_LOWCORE       0
+#define MFEATURE_PCI_MIO       1
 
 #ifndef __ASSEMBLY__
 
index 668dd3e9435adf404f62dce2d106053bcc172bf9..5844f6e09162c0146a099514a9ec02903443ee05 100644 (file)
@@ -25,7 +25,6 @@
 #define MACHINE_FLAG_TE                BIT(11)
 #define MACHINE_FLAG_TLB_GUEST BIT(14)
 #define MACHINE_FLAG_SCC       BIT(17)
-#define MACHINE_FLAG_PCI_MIO   BIT(18)
 
 #define LPP_MAGIC              BIT(31)
 #define LPP_PID_MASK           _AC(0xffffffff, UL)
@@ -78,7 +77,6 @@ extern unsigned long mio_wb_bit_mask;
 #define MACHINE_HAS_TE         (get_lowcore()->machine_flags & MACHINE_FLAG_TE)
 #define MACHINE_HAS_TLB_GUEST  (get_lowcore()->machine_flags & MACHINE_FLAG_TLB_GUEST)
 #define MACHINE_HAS_SCC                (get_lowcore()->machine_flags & MACHINE_FLAG_SCC)
-#define MACHINE_HAS_PCI_MIO    (get_lowcore()->machine_flags & MACHINE_FLAG_PCI_MIO)
 
 /*
  * Console mode. Override with conmode=
index 2af5886702282b58d2b243423dbb9534ae37e8f5..9e673dab7c1187aedf0d1c7fa2f8daa5ce545294 100644 (file)
@@ -249,10 +249,6 @@ static __init void detect_machine_facilities(void)
                clock_comparator_max = -1ULL >> 1;
                system_ctl_set_bit(0, CR0_CLOCK_COMPARATOR_SIGN_BIT);
        }
-       if (IS_ENABLED(CONFIG_PCI) && test_facility(153)) {
-               get_lowcore()->machine_flags |= MACHINE_FLAG_PCI_MIO;
-               /* the control bit is set during PCI initialization */
-       }
 }
 
 static inline void save_vector_registers(void)
index 4c751b6539f865e33358f61e04945a1ec5e7fe6d..487c943cbc4c48311ae93fc9b38512287301edcd 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/cpu.h>
 #include <linux/smp.h>
 #include <asm/text-patching.h>
+#include <asm/machine.h>
 #include <asm/diag.h>
 #include <asm/facility.h>
 #include <asm/elf.h>
@@ -248,7 +249,7 @@ static int __init setup_hwcaps(void)
        if (cpu_has_gs())
                elf_hwcap |= HWCAP_GS;
 
-       if (MACHINE_HAS_PCI_MIO)
+       if (test_machine_feature(MFEATURE_PCI_MIO))
                elf_hwcap |= HWCAP_PCI_MIO;
 
        /* virtualization support */
index 88f72745fa59e16df26b1563de27594aac954a78..7410b22f2cf2f30483e639de56648224f76a2e4a 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/lockdep.h>
 #include <linux/list_sort.h>
 
+#include <asm/machine.h>
 #include <asm/isc.h>
 #include <asm/airq.h>
 #include <asm/facility.h>
@@ -1073,7 +1074,7 @@ char * __init pcibios_setup(char *str)
                return NULL;
        }
        if (!strcmp(str, "nomio")) {
-               get_lowcore()->machine_flags &= ~MACHINE_FLAG_PCI_MIO;
+               clear_machine_feature(MFEATURE_PCI_MIO);
                return NULL;
        }
        if (!strcmp(str, "force_floating")) {
@@ -1148,7 +1149,7 @@ static int __init pci_base_init(void)
                return 0;
        }
 
-       if (MACHINE_HAS_PCI_MIO) {
+       if (test_machine_feature(MFEATURE_PCI_MIO)) {
                static_branch_enable(&have_mio);
                system_ctl_set_bit(2, CR2_MIO_ADDRESSING_BIT);
        }