]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
Revert "x86: guard against straight-line speculation past RET"
authorJan Beulich <jbeulich@suse.com>
Fri, 9 Apr 2021 07:50:40 +0000 (09:50 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 9 Apr 2021 07:53:53 +0000 (09:53 +0200)
This reverts commit 71b0b475d801ebeb83a6ba402425135c314fa2df,
which has no real effect - the most recent version of the patch
had lost the INT3 insn.

xen/Makefile
xen/arch/x86/indirect-thunk.S
xen/include/asm-x86/asm-defns.h

index 3a8fb7ec7e17fd5dd94e768c8b02e85a226b8f3a..9f3be7766d51db02957f24879c794af091b30a67 100644 (file)
@@ -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
index a090b35dcf5215dcd7ced82be5455f766be815fd..7cc22da0ef934516de346538fbb6f3228317eee2 100644 (file)
@@ -11,9 +11,6 @@
 
 #include <asm/asm_defns.h>
 
-/* Don't transform the "ret" further down. */
-.purgem ret
-
 .macro IND_THUNK_RETPOLINE reg:req
         call 2f
 1:
index e164437798fe1905f7140873cdae21dd92c738fc..505f39ad5f769e9f26b1239e01901f67c305d8ea 100644 (file)
     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)
     /*