diff mbox series

parisc: Add alternative patching to synchronize_caches define

Message ID b6e3a223-45e1-18ff-2ce0-c511459d0f0c@bell.net (mailing list archive)
State Accepted, archived
Headers show
Series parisc: Add alternative patching to synchronize_caches define | expand

Commit Message

John David Anglin July 19, 2020, 7:01 p.m. UTC
This change allows the sync barrier instruction to be patched to a nop.

Signed-off-by: Dave Anglin <dave.anglin@bell.net>
---
diff mbox series

Patch

diff --git a/arch/parisc/include/asm/barrier.h b/arch/parisc/include/asm/barrier.h
index dbaaca84f27f..c3f5d567971a 100644
--- a/arch/parisc/include/asm/barrier.h
+++ b/arch/parisc/include/asm/barrier.h
@@ -2,11 +2,15 @@ 
 #ifndef __ASM_BARRIER_H
 #define __ASM_BARRIER_H

+#include <asm/alternative.h>
+
 #ifndef __ASSEMBLY__

 /* The synchronize caches instruction executes as a nop on systems in
    which all memory references are performed in order. */
-#define synchronize_caches() __asm__ __volatile__ ("sync" : : : "memory")
+#define synchronize_caches() asm volatile("sync" \
+	ALTERNATIVE(ALT_COND_NO_SMP, INSN_NOP) \
+	: : : "memory")

 #if defined(CONFIG_SMP)
 #define mb()		do { synchronize_caches(); } while (0)