2 * Process-global memory barriers
4 * Copyright (c) 2018 Red Hat, Inc.
6 * Author: Paolo Bonzini <pbonzini@redhat.com>
9 #ifndef QEMU_SYS_MEMBARRIER_H
10 #define QEMU_SYS_MEMBARRIER_H
12 #ifdef CONFIG_MEMBARRIER
13 /* Only block reordering at the compiler level in the performance-critical
14 * side. The slow side forces processor-level ordering on all other cores
15 * through a system call.
17 extern void smp_mb_global_init(void);
18 extern void smp_mb_global(void);
19 #define smp_mb_placeholder() barrier()
21 /* Keep it simple, execute a real memory barrier on both sides. */
22 static inline void smp_mb_global_init(void) {}
23 #define smp_mb_global() smp_mb()
24 #define smp_mb_placeholder() smp_mb()