From: Jan Beulich Date: Fri, 9 Apr 2021 07:50:40 +0000 (+0200) Subject: Revert "x86: guard against straight-line speculation past RET" X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=9cd905bae87fb06efa59c347ef1e96c5dc6cdb62;p=people%2Fsstabellini%2Fxen-unstable.git%2F.git Revert "x86: guard against straight-line speculation past RET" This reverts commit 71b0b475d801ebeb83a6ba402425135c314fa2df, which has no real effect - the most recent version of the patch had lost the INT3 insn. --- diff --git a/xen/Makefile b/xen/Makefile index 3a8fb7ec7e..9f3be7766d 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -145,10 +145,7 @@ t2 = $(call as-insn,$(CC) -I$(BASEDIR)/include,".include \"asm-x86/asm-defns.h\" # https://bugs.llvm.org/show_bug.cgi?id=36110 t3 = $(call as-insn,$(CC),".macro FOO;.endm"$(close); asm volatile $(open)".macro FOO;.endm",-no-integrated-as) -# Check whether macros can override insn mnemonics in inline assembly. -t4 = $(call as-insn,$(CC),".macro ret; .error; .endm; .macro retq; .error; .endm",-no-integrated-as) - -CLANG_FLAGS += $(call or,$(t1),$(t2),$(t3),$(t4)) +CLANG_FLAGS += $(call or,$(t1),$(t2),$(t3)) endif CLANG_FLAGS += -Werror=unknown-warning-option diff --git a/xen/arch/x86/indirect-thunk.S b/xen/arch/x86/indirect-thunk.S index a090b35dcf..7cc22da0ef 100644 --- a/xen/arch/x86/indirect-thunk.S +++ b/xen/arch/x86/indirect-thunk.S @@ -11,9 +11,6 @@ #include -/* Don't transform the "ret" further down. */ -.purgem ret - .macro IND_THUNK_RETPOLINE reg:req call 2f 1: diff --git a/xen/include/asm-x86/asm-defns.h b/xen/include/asm-x86/asm-defns.h index e164437798..505f39ad5f 100644 --- a/xen/include/asm-x86/asm-defns.h +++ b/xen/include/asm-x86/asm-defns.h @@ -57,22 +57,6 @@ INDIRECT_BRANCH jmp \arg .endm -/* - * To guard against speculation past RET, insert a breakpoint insn - * immediately after them. - */ -.macro ret operand:vararg - retq \operand -.endm -.macro retq operand:vararg - .ifb \operand - .byte 0xc3 - .else - .byte 0xc2 - .word \operand - .endif -.endm - .macro guest_access_mask_ptr ptr:req, scratch1:req, scratch2:req #if defined(CONFIG_SPECULATIVE_HARDEN_GUEST_ACCESS) /*