drm/panthor: Don't add write fences to the shared BOs
[drm/drm-misc.git] / arch / riscv / include / asm / sync_core.h
blob9153016da8f14b31932bef1eb6c51ef7c1669dd3
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_RISCV_SYNC_CORE_H
3 #define _ASM_RISCV_SYNC_CORE_H
5 /*
6 * RISC-V implements return to user-space through an xRET instruction,
7 * which is not core serializing.
8 */
9 static inline void sync_core_before_usermode(void)
11 asm volatile ("fence.i" ::: "memory");
14 #ifdef CONFIG_SMP
16 * Ensure the next switch_mm() on every CPU issues a core serializing
17 * instruction for the given @mm.
19 static inline void prepare_sync_core_cmd(struct mm_struct *mm)
21 cpumask_setall(&mm->context.icache_stale_mask);
23 #else
24 static inline void prepare_sync_core_cmd(struct mm_struct *mm)
27 #endif /* CONFIG_SMP */
29 #endif /* _ASM_RISCV_SYNC_CORE_H */