| # Feature name: membarrier-sync-core |
| # Kconfig: ARCH_HAS_MEMBARRIER_SYNC_CORE |
| # description: arch supports core serializing membarrier |
| # Architecture requirements |
| # Rely on implicit context synchronization as a result of exception return |
| # when returning from IPI handler, and when returning to user-space. |
| # x86-32 uses IRET as return from interrupt, which takes care of the IPI. |
| # However, it uses both IRET and SYSEXIT to go back to user-space. The IRET |
| # instruction is core serializing, but not SYSEXIT. |
| # x86-64 uses IRET as return from interrupt, which takes care of the IPI. |
| # However, it can return to user-space through either SYSRETL (compat code), |
| # Given that neither SYSRET{L,Q}, nor SYSEXIT, are core serializing, we rely |
| # instead on write_cr3() performed by switch_mm() to provide core serialization |
| # after changing the current mm, and deal with the special case of kthread -> |
| # uthread (temporarily keeping current mm into active_mm) by issuing a |
| # sync_core_before_usermode() in that specific case. |