70 lines · plain
1#2# Feature name: membarrier-sync-core3# Kconfig: ARCH_HAS_MEMBARRIER_SYNC_CORE4# description: arch supports core serializing membarrier5#6# Architecture requirements7#8# * arm/arm64/powerpc/s3909#10# Rely on implicit context synchronization as a result of exception return11# when returning from IPI handler, and when returning to user-space.12#13# * riscv14#15# riscv uses xRET as return from interrupt and to return to user-space.16#17# Given that xRET is not core serializing, we rely on FENCE.I for providing18# core serialization:19#20# - by calling sync_core_before_usermode() on return from interrupt (cf.21# ipi_sync_core()),22#23# - via switch_mm() and sync_core_before_usermode() (respectively, for24# uthread->uthread and kthread->uthread transitions) before returning25# to user-space.26#27# The serialization in switch_mm() is activated by prepare_sync_core_cmd().28#29# * x8630#31# x86-32 uses IRET as return from interrupt, which takes care of the IPI.32# However, it uses both IRET and SYSEXIT to go back to user-space. The IRET33# instruction is core serializing, but not SYSEXIT.34#35# x86-64 uses IRET as return from interrupt, which takes care of the IPI.36# However, it can return to user-space through either SYSRETL (compat code),37# SYSRETQ, or IRET.38#39# Given that neither SYSRET{L,Q}, nor SYSEXIT, are core serializing, we rely40# instead on write_cr3() performed by switch_mm() to provide core serialization41# after changing the current mm, and deal with the special case of kthread ->42# uthread (temporarily keeping current mm into active_mm) by issuing a43# sync_core_before_usermode() in that specific case.44#45 -----------------------46 | arch |status|47 -----------------------48 | alpha: | TODO |49 | arc: | TODO |50 | arm: | ok |51 | arm64: | ok |52 | csky: | TODO |53 | hexagon: | TODO |54 | loongarch: | TODO |55 | m68k: | TODO |56 | microblaze: | TODO |57 | mips: | TODO |58 | nios2: | TODO |59 | openrisc: | TODO |60 | parisc: | TODO |61 | powerpc: | ok |62 | riscv: | ok |63 | s390: | ok |64 | sh: | TODO |65 | sparc: | TODO |66 | um: | TODO |67 | x86: | ok |68 | xtensa: | TODO |69 -----------------------70