]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/barrier: Use alternative instead of ifdef for bcr_serialize()
authorHeiko Carstens <hca@linux.ibm.com>
Fri, 8 May 2026 15:02:46 +0000 (17:02 +0200)
committerAlexander Gordeev <agordeev@linux.ibm.com>
Wed, 20 May 2026 07:48:03 +0000 (09:48 +0200)
Use an alternative to implement bcr_serialize() and use alternative
patching to select between serialization and fast-serialization
depending on the corresponding facility bit.

Reviewed-by: Jan Polensky <japo@linux.ibm.com>
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
arch/s390/include/asm/barrier.h

index dad02f5b3c8d306534fb404d361e0d44d81e9847..d1e4201f38506f5bdeb9988a6bc373d0f1e172bf 100644 (file)
@@ -8,6 +8,7 @@
 #ifndef __ASM_BARRIER_H
 #define __ASM_BARRIER_H
 
+#include <asm/alternative.h>
 #include <asm/march.h>
 
 /*
  * to devices.
  */
 
-#ifdef MARCH_HAS_Z196_FEATURES
-/* Fast-BCR without checkpoint synchronization */
-#define __ASM_BCR_SERIALIZE "bcr 14,0"
-#else
-#define __ASM_BCR_SERIALIZE "bcr 15,0"
-#endif
-
 static __always_inline void bcr_serialize(void)
 {
-       asm volatile(__ASM_BCR_SERIALIZE : : : "memory");
+       asm_inline volatile(
+               ALTERNATIVE("bcr 15,0", "bcr 14,0", ALT_FACILITY(45))
+               : : : "memory");
 }
 
 #define __mb()         bcr_serialize()