1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * Common place for both 32- and 64-bit entry routines. 4 */ 5 6 #include <linux/linkage.h> 7 #include <asm/export.h> 8 #include <asm/msr-index.h> 9 #include <asm/unwind_hints.h> 10 #include <asm/segment.h> 11 #include <asm/cache.h> 12 13 .pushsection .noinstr.text, "ax" 14 15 SYM_FUNC_START(entry_ibpb) 16 movl $MSR_IA32_PRED_CMD, %ecx 17 movl $PRED_CMD_IBPB, %eax 18 xorl %edx, %edx 19 wrmsr 20 RET 21 SYM_FUNC_END(entry_ibpb) 22 /* For KVM */ 23 EXPORT_SYMBOL_GPL(entry_ibpb); 24 25 .popsection 26 27 /* 28 * Define the VERW operand that is disguised as entry code so that 29 * it can be referenced with KPTI enabled. This ensure VERW can be 30 * used late in exit-to-user path after page tables are switched. 31 */ 32 .pushsection .entry.text, "ax" 33 34 .align L1_CACHE_BYTES, 0xcc 35 SYM_CODE_START_NOALIGN(mds_verw_sel) 36 UNWIND_HINT_UNDEFINED 37 ANNOTATE_NOENDBR 38 .word __KERNEL_DS 39 .align L1_CACHE_BYTES, 0xcc 40 SYM_CODE_END(mds_verw_sel); 41 /* For KVM */ 42 EXPORT_SYMBOL_GPL(mds_verw_sel); 43 44 .popsection 45 46