From: Heiko Carstens Date: Fri, 8 May 2026 15:02:46 +0000 (+0200) Subject: s390/barrier: Use alternative instead of ifdef for bcr_serialize() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a77ec04920f58dbd95a6e9e1081605f98e63c52d;p=thirdparty%2Fkernel%2Flinux.git s390/barrier: Use alternative instead of ifdef for bcr_serialize() 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 Reviewed-by: Alexander Gordeev Signed-off-by: Heiko Carstens Signed-off-by: Alexander Gordeev --- diff --git a/arch/s390/include/asm/barrier.h b/arch/s390/include/asm/barrier.h index dad02f5b3c8d3..d1e4201f38506 100644 --- a/arch/s390/include/asm/barrier.h +++ b/arch/s390/include/asm/barrier.h @@ -8,6 +8,7 @@ #ifndef __ASM_BARRIER_H #define __ASM_BARRIER_H +#include #include /* @@ -16,16 +17,11 @@ * 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()