Unverified Commit 7c32c286 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!12767 x86/bugs: Use code segment selector for VERW operand

parents 42a01c6d d6ed7123
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -332,7 +332,16 @@
 * Note: Only the memory operand variant of VERW clears the CPU buffers.
 */
.macro CLEAR_CPU_BUFFERS
	ALTERNATIVE "", __stringify(verw _ASM_RIP(mds_verw_sel)), X86_FEATURE_CLEAR_CPU_BUF
#ifdef CONFIG_X86_64
	ALTERNATIVE "", "verw mds_verw_sel(%rip)", X86_FEATURE_CLEAR_CPU_BUF
#else
	/*
	 * In 32bit mode, the memory operand must be a %cs reference. The data
	 * segments may not be usable (vm86 mode), and the stack segment may not
	 * be flat (ESPFIX32).
	 */
	ALTERNATIVE "", "verw %cs:mds_verw_sel", X86_FEATURE_CLEAR_CPU_BUF
#endif
.endm

#ifdef CONFIG_X86_64