]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/setup: Recognize sequential instruction fetching facility
authorVasily Gorbik <gor@linux.ibm.com>
Wed, 28 Aug 2024 17:06:49 +0000 (19:06 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Thu, 29 Aug 2024 20:56:34 +0000 (22:56 +0200)
When sequential instruction fetching facility is present,
certain guarantees are provided for code patching. In particular,
atomic overwrites within 8 aligned bytes is safe from an
instruction-fetching point of view.

Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/include/asm/setup.h
arch/s390/kernel/early.c

index 50b943f301553c5c116532d15d3585d3ca00aea1..70b920b32827e8bbf913bd5cfc72dd7d6e2a285f 100644 (file)
@@ -34,6 +34,7 @@
 #define MACHINE_FLAG_SCC       BIT(17)
 #define MACHINE_FLAG_PCI_MIO   BIT(18)
 #define MACHINE_FLAG_RDP       BIT(19)
+#define MACHINE_FLAG_SEQ_INSN  BIT(20)
 
 #define LPP_MAGIC              BIT(31)
 #define LPP_PID_MASK           _AC(0xffffffff, UL)
@@ -95,6 +96,7 @@ extern unsigned long mio_wb_bit_mask;
 #define MACHINE_HAS_SCC                (get_lowcore()->machine_flags & MACHINE_FLAG_SCC)
 #define MACHINE_HAS_PCI_MIO    (get_lowcore()->machine_flags & MACHINE_FLAG_PCI_MIO)
 #define MACHINE_HAS_RDP                (get_lowcore()->machine_flags & MACHINE_FLAG_RDP)
+#define MACHINE_HAS_SEQ_INSN   (get_lowcore()->machine_flags & MACHINE_FLAG_SEQ_INSN)
 
 /*
  * Console mode. Override with conmode=
index cc4264d230196e239f8c451058b0956d1dea1813..62f8f5a750a308a587e2a20ffd75ad368c8da696 100644 (file)
@@ -268,6 +268,8 @@ static __init void detect_machine_facilities(void)
        }
        if (test_facility(194))
                get_lowcore()->machine_flags |= MACHINE_FLAG_RDP;
+       if (test_facility(85))
+               get_lowcore()->machine_flags |= MACHINE_FLAG_SEQ_INSN;
 }
 
 static inline void save_vector_registers(void)