From: Heiko Carstens Date: Fri, 7 Feb 2025 14:48:58 +0000 (+0100) Subject: s390/pci: Get rid of MACHINE_HAS_PCI_MIO X-Git-Tag: v6.15-rc1~113^2~50 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1a8da0dec77e0149b482698a2c1daab3a02ef7a;p=thirdparty%2Fkernel%2Flinux.git s390/pci: Get rid of MACHINE_HAS_PCI_MIO 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 Tested-by: Niklas Schnelle Reviewed-by: Vasily Gorbik Signed-off-by: Heiko Carstens Signed-off-by: Vasily Gorbik --- diff --git a/arch/s390/boot/startup.c b/arch/s390/boot/startup.c index f8e6d7eb7cc2b..8081f06ad2587 100644 --- a/arch/s390/boot/startup.c +++ b/arch/s390/boot/startup.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -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) diff --git a/arch/s390/include/asm/machine.h b/arch/s390/include/asm/machine.h index bc30384d396d8..488e5d6417130 100644 --- a/arch/s390/include/asm/machine.h +++ b/arch/s390/include/asm/machine.h @@ -9,6 +9,7 @@ #include #define MFEATURE_LOWCORE 0 +#define MFEATURE_PCI_MIO 1 #ifndef __ASSEMBLY__ diff --git a/arch/s390/include/asm/setup.h b/arch/s390/include/asm/setup.h index 668dd3e9435ad..5844f6e09162c 100644 --- a/arch/s390/include/asm/setup.h +++ b/arch/s390/include/asm/setup.h @@ -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= diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c index 2af5886702282..9e673dab7c118 100644 --- a/arch/s390/kernel/early.c +++ b/arch/s390/kernel/early.c @@ -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) diff --git a/arch/s390/kernel/processor.c b/arch/s390/kernel/processor.c index 4c751b6539f86..487c943cbc4c4 100644 --- a/arch/s390/kernel/processor.c +++ b/arch/s390/kernel/processor.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -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 */ diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c index 88f72745fa59e..7410b22f2cf2f 100644 --- a/arch/s390/pci/pci.c +++ b/arch/s390/pci/pci.c @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -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); }