Blame SOURCES/openssl-1.1.1-intel-cet.patch

9b88be
diff -up openssl-1.1.1e/crypto/aes/asm/aesni-x86_64.pl.intel-cet openssl-1.1.1e/crypto/aes/asm/aesni-x86_64.pl
9b88be
--- openssl-1.1.1e/crypto/aes/asm/aesni-x86_64.pl.intel-cet	2020-03-17 15:31:17.000000000 +0100
9b88be
+++ openssl-1.1.1e/crypto/aes/asm/aesni-x86_64.pl	2020-03-19 17:07:02.626522694 +0100
9b88be
@@ -275,6 +275,7 @@ $code.=<<___;
9b88be
 .align	16
9b88be
 ${PREFIX}_encrypt:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 	movups	($inp),$inout0		# load input
9b88be
 	mov	240($key),$rounds	# key->rounds
9b88be
 ___
9b88be
@@ -293,6 +294,7 @@ $code.=<<___;
9b88be
 .align	16
9b88be
 ${PREFIX}_decrypt:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 	movups	($inp),$inout0		# load input
9b88be
 	mov	240($key),$rounds	# key->rounds
9b88be
 ___
9b88be
@@ -613,6 +615,7 @@ $code.=<<___;
9b88be
 .align	16
9b88be
 aesni_ecb_encrypt:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 ___
9b88be
 $code.=<<___ if ($win64);
9b88be
 	lea	-0x58(%rsp),%rsp
9b88be
@@ -985,6 +988,7 @@ $code.=<<___;
9b88be
 .align	16
9b88be
 aesni_ccm64_encrypt_blocks:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 ___
9b88be
 $code.=<<___ if ($win64);
9b88be
 	lea	-0x58(%rsp),%rsp
9b88be
@@ -1077,6 +1081,7 @@ $code.=<<___;
9b88be
 .align	16
9b88be
 aesni_ccm64_decrypt_blocks:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 ___
9b88be
 $code.=<<___ if ($win64);
9b88be
 	lea	-0x58(%rsp),%rsp
9b88be
@@ -1203,6 +1208,7 @@ $code.=<<___;
9b88be
 .align	16
9b88be
 aesni_ctr32_encrypt_blocks:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 	cmp	\$1,$len
9b88be
 	jne	.Lctr32_bulk
9b88be
 
9b88be
@@ -1775,6 +1781,7 @@ $code.=<<___;
9b88be
 .align	16
9b88be
 aesni_xts_encrypt:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 	lea	(%rsp),%r11			# frame pointer
9b88be
 .cfi_def_cfa_register	%r11
9b88be
 	push	%rbp
9b88be
@@ -2258,6 +2265,7 @@ $code.=<<___;
9b88be
 .align	16
9b88be
 aesni_xts_decrypt:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 	lea	(%rsp),%r11			# frame pointer
9b88be
 .cfi_def_cfa_register	%r11
9b88be
 	push	%rbp
9b88be
@@ -2783,6 +2791,7 @@ $code.=<<___;
9b88be
 .align	32
9b88be
 aesni_ocb_encrypt:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 	lea	(%rsp),%rax
9b88be
 	push	%rbx
9b88be
 .cfi_push	%rbx
9b88be
@@ -3249,6 +3258,7 @@ __ocb_encrypt1:
9b88be
 .align	32
9b88be
 aesni_ocb_decrypt:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 	lea	(%rsp),%rax
9b88be
 	push	%rbx
9b88be
 .cfi_push	%rbx
9b88be
@@ -3737,6 +3747,7 @@ $code.=<<___;
9b88be
 .align	16
9b88be
 ${PREFIX}_cbc_encrypt:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 	test	$len,$len		# check length
9b88be
 	jz	.Lcbc_ret
9b88be
 
9b88be
diff -up openssl-1.1.1e/crypto/aes/asm/vpaes-x86_64.pl.intel-cet openssl-1.1.1e/crypto/aes/asm/vpaes-x86_64.pl
9b88be
--- openssl-1.1.1e/crypto/aes/asm/vpaes-x86_64.pl.intel-cet	2020-03-17 15:31:17.000000000 +0100
9b88be
+++ openssl-1.1.1e/crypto/aes/asm/vpaes-x86_64.pl	2020-03-19 17:00:15.974621757 +0100
9b88be
@@ -696,6 +696,7 @@ _vpaes_schedule_mangle:
9b88be
 .align	16
9b88be
 ${PREFIX}_set_encrypt_key:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 ___
9b88be
 $code.=<<___ if ($win64);
9b88be
 	lea	-0xb8(%rsp),%rsp
9b88be
@@ -746,6 +747,7 @@ $code.=<<___;
9b88be
 .align	16
9b88be
 ${PREFIX}_set_decrypt_key:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 ___
9b88be
 $code.=<<___ if ($win64);
9b88be
 	lea	-0xb8(%rsp),%rsp
9b88be
@@ -801,6 +803,7 @@ $code.=<<___;
9b88be
 .align	16
9b88be
 ${PREFIX}_encrypt:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 ___
9b88be
 $code.=<<___ if ($win64);
9b88be
 	lea	-0xb8(%rsp),%rsp
9b88be
@@ -846,6 +849,7 @@ $code.=<<___;
9b88be
 .align	16
9b88be
 ${PREFIX}_decrypt:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 ___
9b88be
 $code.=<<___ if ($win64);
9b88be
 	lea	-0xb8(%rsp),%rsp
9b88be
@@ -897,6 +901,7 @@ $code.=<<___;
9b88be
 .align	16
9b88be
 ${PREFIX}_cbc_encrypt:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 	xchg	$key,$len
9b88be
 ___
9b88be
 ($len,$key)=($key,$len);
9b88be
diff -up openssl-1.1.1e/crypto/async/arch/async_posix.c.intel-cet openssl-1.1.1e/crypto/async/arch/async_posix.c
9b88be
--- openssl-1.1.1e/crypto/async/arch/async_posix.c.intel-cet	2020-03-17 15:31:17.000000000 +0100
9b88be
+++ openssl-1.1.1e/crypto/async/arch/async_posix.c	2020-03-19 17:00:15.974621757 +0100
9b88be
@@ -34,7 +34,9 @@ void async_local_cleanup(void)
9b88be
 
9b88be
 int async_fibre_makecontext(async_fibre *fibre)
9b88be
 {
9b88be
+#ifndef USE_SWAPCONTEXT
9b88be
     fibre->env_init = 0;
9b88be
+#endif
9b88be
     if (getcontext(&fibre->fibre) == 0) {
9b88be
         fibre->fibre.uc_stack.ss_sp = OPENSSL_malloc(STACKSIZE);
9b88be
         if (fibre->fibre.uc_stack.ss_sp != NULL) {
9b88be
diff -up openssl-1.1.1e/crypto/async/arch/async_posix.h.intel-cet openssl-1.1.1e/crypto/async/arch/async_posix.h
9b88be
--- openssl-1.1.1e/crypto/async/arch/async_posix.h.intel-cet	2020-03-19 17:00:15.435631166 +0100
9b88be
+++ openssl-1.1.1e/crypto/async/arch/async_posix.h	2020-03-19 17:00:15.975621739 +0100
9b88be
@@ -25,17 +25,33 @@
9b88be
 #  define ASYNC_POSIX
9b88be
 #  define ASYNC_ARCH
9b88be
 
9b88be
+#  ifdef __CET__
9b88be
+/*
9b88be
+ * When Intel CET is enabled, makecontext will create a different
9b88be
+ * shadow stack for each context.  async_fibre_swapcontext cannot
9b88be
+ * use _longjmp.  It must call swapcontext to swap shadow stack as
9b88be
+ * well as normal stack.
9b88be
+ */
9b88be
+#   define USE_SWAPCONTEXT
9b88be
+#  endif
9b88be
 #  include <ucontext.h>
9b88be
-#  include <setjmp.h>
9b88be
+#  ifndef USE_SWAPCONTEXT
9b88be
+#   include <setjmp.h>
9b88be
+#  endif
9b88be
 
9b88be
 typedef struct async_fibre_st {
9b88be
     ucontext_t fibre;
9b88be
+#  ifndef USE_SWAPCONTEXT
9b88be
     jmp_buf env;
9b88be
     int env_init;
9b88be
+#  endif
9b88be
 } async_fibre;
9b88be
 
9b88be
 static ossl_inline int async_fibre_swapcontext(async_fibre *o, async_fibre *n, int r)
9b88be
 {
9b88be
+#  ifdef USE_SWAPCONTEXT
9b88be
+    swapcontext(&o->fibre, &n->fibre);
9b88be
+#  else
9b88be
     o->env_init = 1;
9b88be
 
9b88be
     if (!r || !_setjmp(o->env)) {
9b88be
@@ -44,6 +60,7 @@ static ossl_inline int async_fibre_swapc
9b88be
         else
9b88be
             setcontext(&n->fibre);
9b88be
     }
9b88be
+#  endif
9b88be
 
9b88be
     return 1;
9b88be
 }
9b88be
diff -up openssl-1.1.1e/crypto/camellia/asm/cmll-x86_64.pl.intel-cet openssl-1.1.1e/crypto/camellia/asm/cmll-x86_64.pl
9b88be
--- openssl-1.1.1e/crypto/camellia/asm/cmll-x86_64.pl.intel-cet	2020-03-17 15:31:17.000000000 +0100
9b88be
+++ openssl-1.1.1e/crypto/camellia/asm/cmll-x86_64.pl	2020-03-19 17:00:15.975621739 +0100
9b88be
@@ -685,6 +685,7 @@ $code.=<<___;
9b88be
 .align	16
9b88be
 Camellia_cbc_encrypt:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 	cmp	\$0,%rdx
9b88be
 	je	.Lcbc_abort
9b88be
 	push	%rbx
9b88be
diff -up openssl-1.1.1e/crypto/modes/asm/ghash-x86_64.pl.intel-cet openssl-1.1.1e/crypto/modes/asm/ghash-x86_64.pl
9b88be
--- openssl-1.1.1e/crypto/modes/asm/ghash-x86_64.pl.intel-cet	2020-03-17 15:31:17.000000000 +0100
9b88be
+++ openssl-1.1.1e/crypto/modes/asm/ghash-x86_64.pl	2020-03-19 17:00:15.975621739 +0100
9b88be
@@ -239,6 +239,7 @@ $code=<<___;
9b88be
 .align	16
9b88be
 gcm_gmult_4bit:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 	push	%rbx
9b88be
 .cfi_push	%rbx
9b88be
 	push	%rbp		# %rbp and others are pushed exclusively in
9b88be
@@ -286,6 +287,7 @@ $code.=<<___;
9b88be
 .align	16
9b88be
 gcm_ghash_4bit:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 	push	%rbx
9b88be
 .cfi_push	%rbx
9b88be
 	push	%rbp
9b88be
@@ -612,6 +614,7 @@ $code.=<<___;
9b88be
 .align	16
9b88be
 gcm_gmult_clmul:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 .L_gmult_clmul:
9b88be
 	movdqu		($Xip),$Xi
9b88be
 	movdqa		.Lbswap_mask(%rip),$T3
9b88be
@@ -663,6 +666,7 @@ $code.=<<___;
9b88be
 .align	32
9b88be
 gcm_ghash_clmul:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 .L_ghash_clmul:
9b88be
 ___
9b88be
 $code.=<<___ if ($win64);
9b88be
@@ -1166,6 +1170,7 @@ $code.=<<___;
9b88be
 .align	32
9b88be
 gcm_gmult_avx:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 	jmp	.L_gmult_clmul
9b88be
 .cfi_endproc
9b88be
 .size	gcm_gmult_avx,.-gcm_gmult_avx
9b88be
@@ -1177,6 +1182,7 @@ $code.=<<___;
9b88be
 .align	32
9b88be
 gcm_ghash_avx:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 ___
9b88be
 if ($avx) {
9b88be
 my ($Xip,$Htbl,$inp,$len)=@_4args;
9b88be
diff -up openssl-1.1.1e/crypto/perlasm/cbc.pl.intel-cet openssl-1.1.1e/crypto/perlasm/cbc.pl
9b88be
--- openssl-1.1.1e/crypto/perlasm/cbc.pl.intel-cet	2020-03-17 15:31:17.000000000 +0100
9b88be
+++ openssl-1.1.1e/crypto/perlasm/cbc.pl	2020-03-19 17:00:15.976621722 +0100
9b88be
@@ -165,21 +165,28 @@ sub cbc
9b88be
 	&jmp_ptr($count);
9b88be
 
9b88be
 &set_label("ej7");
9b88be
+	&endbranch()
9b88be
 	&movb(&HB("edx"),	&BP(6,$in,"",0));
9b88be
 	&shl("edx",8);
9b88be
 &set_label("ej6");
9b88be
+	&endbranch()
9b88be
 	&movb(&HB("edx"),	&BP(5,$in,"",0));
9b88be
 &set_label("ej5");
9b88be
+	&endbranch()
9b88be
 	&movb(&LB("edx"),	&BP(4,$in,"",0));
9b88be
 &set_label("ej4");
9b88be
+	&endbranch()
9b88be
 	&mov("ecx",		&DWP(0,$in,"",0));
9b88be
 	&jmp(&label("ejend"));
9b88be
 &set_label("ej3");
9b88be
+	&endbranch()
9b88be
 	&movb(&HB("ecx"),	&BP(2,$in,"",0));
9b88be
 	&shl("ecx",8);
9b88be
 &set_label("ej2");
9b88be
+	&endbranch()
9b88be
 	&movb(&HB("ecx"),	&BP(1,$in,"",0));
9b88be
 &set_label("ej1");
9b88be
+	&endbranch()
9b88be
 	&movb(&LB("ecx"),	&BP(0,$in,"",0));
9b88be
 &set_label("ejend");
9b88be
 
9b88be
diff -up openssl-1.1.1e/crypto/perlasm/x86_64-xlate.pl.intel-cet openssl-1.1.1e/crypto/perlasm/x86_64-xlate.pl
9b88be
--- openssl-1.1.1e/crypto/perlasm/x86_64-xlate.pl.intel-cet	2020-03-17 15:31:17.000000000 +0100
9b88be
+++ openssl-1.1.1e/crypto/perlasm/x86_64-xlate.pl	2020-03-19 17:00:15.984621582 +0100
9b88be
@@ -101,6 +101,33 @@ elsif (!$gas)
9b88be
     $decor="\$L\$";
9b88be
 }
9b88be
 
9b88be
+my $cet_property;
9b88be
+if ($flavour =~ /elf/) {
9b88be
+	# Always generate .note.gnu.property section for ELF outputs to
9b88be
+	# mark Intel CET support since all input files must be marked
9b88be
+	# with Intel CET support in order for linker to mark output with
9b88be
+	# Intel CET support.
9b88be
+	my $p2align=3; $p2align=2 if ($flavour eq "elf32");
9b88be
+	$cet_property = <<_____;
9b88be
+	.section ".note.gnu.property", "a"
9b88be
+	.p2align $p2align
9b88be
+	.long 1f - 0f
9b88be
+	.long 4f - 1f
9b88be
+	.long 5
9b88be
+0:
9b88be
+	.asciz "GNU"
9b88be
+1:
9b88be
+	.p2align $p2align
9b88be
+	.long 0xc0000002
9b88be
+	.long 3f - 2f
9b88be
+2:
9b88be
+	.long 3
9b88be
+3:
9b88be
+	.p2align $p2align
9b88be
+4:
9b88be
+_____
9b88be
+}
9b88be
+
9b88be
 my $current_segment;
9b88be
 my $current_function;
9b88be
 my %globals;
9b88be
@@ -1213,6 +1240,7 @@ while(defined(my $line=<>)) {
9b88be
     print $line,"\n";
9b88be
 }
9b88be
 
9b88be
+print "$cet_property"			if ($cet_property);
9b88be
 print "\n$current_segment\tENDS\n"	if ($current_segment && $masm);
9b88be
 print "END\n"				if ($masm);
9b88be
 
9b88be
diff -up openssl-1.1.1e/crypto/perlasm/x86gas.pl.intel-cet openssl-1.1.1e/crypto/perlasm/x86gas.pl
9b88be
--- openssl-1.1.1e/crypto/perlasm/x86gas.pl.intel-cet	2020-03-17 15:31:17.000000000 +0100
9b88be
+++ openssl-1.1.1e/crypto/perlasm/x86gas.pl	2020-03-19 17:00:15.985621565 +0100
9b88be
@@ -124,6 +124,7 @@ sub ::function_begin_B
9b88be
     push(@out,".align\t$align\n");
9b88be
     push(@out,"$func:\n");
9b88be
     push(@out,"$begin:\n")		if ($global);
9b88be
+    &::endbranch();
9b88be
     $::stack=4;
9b88be
 }
9b88be
 
9b88be
@@ -172,6 +173,26 @@ sub ::file_end
9b88be
 	else		{ push (@out,"$tmp\n"); }
9b88be
     }
9b88be
     push(@out,$initseg) if ($initseg);
9b88be
+    if ($::elf) {
9b88be
+	push(@out,"
9b88be
+	.section \".note.gnu.property\", \"a\"
9b88be
+	.p2align 2
9b88be
+	.long 1f - 0f
9b88be
+	.long 4f - 1f
9b88be
+	.long 5
9b88be
+0:
9b88be
+	.asciz \"GNU\"
9b88be
+1:
9b88be
+	.p2align 2
9b88be
+	.long 0xc0000002
9b88be
+	.long 3f - 2f
9b88be
+2:
9b88be
+	.long 3
9b88be
+3:
9b88be
+	.p2align 2
9b88be
+4:
9b88be
+");
9b88be
+    }
9b88be
 }
9b88be
 
9b88be
 sub ::data_byte	{   push(@out,".byte\t".join(',',@_)."\n");   }
9b88be
diff -up openssl-1.1.1e/crypto/poly1305/asm/poly1305-x86_64.pl.intel-cet openssl-1.1.1e/crypto/poly1305/asm/poly1305-x86_64.pl
9b88be
--- openssl-1.1.1e/crypto/poly1305/asm/poly1305-x86_64.pl.intel-cet	2020-03-19 17:00:38.185234015 +0100
9b88be
+++ openssl-1.1.1e/crypto/poly1305/asm/poly1305-x86_64.pl	2020-03-19 17:05:46.575850341 +0100
9b88be
@@ -2806,6 +2806,7 @@ $code.=<<___;
9b88be
 .align	32
9b88be
 poly1305_blocks_vpmadd52:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 	shr	\$4,$len
9b88be
 	jz	.Lno_data_vpmadd52		# too short
9b88be
 
9b88be
@@ -3739,6 +3740,7 @@ $code.=<<___;
9b88be
 .align	32
9b88be
 poly1305_emit_base2_44:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 	mov	0($ctx),%r8	# load hash value
9b88be
 	mov	8($ctx),%r9
9b88be
 	mov	16($ctx),%r10
9b88be
diff -up openssl-1.1.1e/crypto/rc4/asm/rc4-x86_64.pl.intel-cet openssl-1.1.1e/crypto/rc4/asm/rc4-x86_64.pl
9b88be
--- openssl-1.1.1e/crypto/rc4/asm/rc4-x86_64.pl.intel-cet	2020-03-19 17:00:38.190233928 +0100
9b88be
+++ openssl-1.1.1e/crypto/rc4/asm/rc4-x86_64.pl	2020-03-19 17:05:02.598618064 +0100
9b88be
@@ -140,6 +140,7 @@ $code=<<___;
9b88be
 .align	16
9b88be
 RC4:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 	or	$len,$len
9b88be
 	jne	.Lentry
9b88be
 	ret
9b88be
@@ -455,6 +456,7 @@ $code.=<<___;
9b88be
 .align	16
9b88be
 RC4_set_key:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 	lea	8($dat),$dat
9b88be
 	lea	($inp,$len),$inp
9b88be
 	neg	$len
9b88be
@@ -529,6 +531,7 @@ RC4_set_key:
9b88be
 .align	16
9b88be
 RC4_options:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 	lea	.Lopts(%rip),%rax
9b88be
 	mov	OPENSSL_ia32cap_P(%rip),%edx
9b88be
 	bt	\$20,%edx
9b88be
diff -up openssl-1.1.1e/crypto/x86_64cpuid.pl.intel-cet openssl-1.1.1e/crypto/x86_64cpuid.pl
9b88be
--- openssl-1.1.1e/crypto/x86_64cpuid.pl.intel-cet	2020-03-17 15:31:17.000000000 +0100
9b88be
+++ openssl-1.1.1e/crypto/x86_64cpuid.pl	2020-03-19 17:03:58.172742775 +0100
9b88be
@@ -40,6 +40,7 @@ print<<___;
9b88be
 .align	16
9b88be
 OPENSSL_atomic_add:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 	movl	($arg1),%eax
9b88be
 .Lspin:	leaq	($arg2,%rax),%r8
9b88be
 	.byte	0xf0		# lock
9b88be
@@ -56,6 +57,7 @@ OPENSSL_atomic_add:
9b88be
 .align	16
9b88be
 OPENSSL_rdtsc:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 	rdtsc
9b88be
 	shl	\$32,%rdx
9b88be
 	or	%rdx,%rax
9b88be
@@ -68,6 +70,7 @@ OPENSSL_rdtsc:
9b88be
 .align	16
9b88be
 OPENSSL_ia32_cpuid:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 	mov	%rbx,%r8		# save %rbx
9b88be
 .cfi_register	%rbx,%r8
9b88be
 
9b88be
@@ -237,6 +240,7 @@ OPENSSL_ia32_cpuid:
9b88be
 .align  16
9b88be
 OPENSSL_cleanse:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 	xor	%rax,%rax
9b88be
 	cmp	\$15,$arg2
9b88be
 	jae	.Lot
9b88be
@@ -274,6 +278,7 @@ OPENSSL_cleanse:
9b88be
 .align  16
9b88be
 CRYPTO_memcmp:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 	xor	%rax,%rax
9b88be
 	xor	%r10,%r10
9b88be
 	cmp	\$0,$arg3
9b88be
@@ -312,6 +317,7 @@ print<<___ if (!$win64);
9b88be
 .align	16
9b88be
 OPENSSL_wipe_cpu:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 	pxor	%xmm0,%xmm0
9b88be
 	pxor	%xmm1,%xmm1
9b88be
 	pxor	%xmm2,%xmm2
9b88be
@@ -346,6 +352,8 @@ print<<___ if ($win64);
9b88be
 .type	OPENSSL_wipe_cpu,\@abi-omnipotent
9b88be
 .align	16
9b88be
 OPENSSL_wipe_cpu:
9b88be
+.cfi_startproc
9b88be
+	endbranch
9b88be
 	pxor	%xmm0,%xmm0
9b88be
 	pxor	%xmm1,%xmm1
9b88be
 	pxor	%xmm2,%xmm2
9b88be
@@ -376,6 +384,7 @@ print<<___;
9b88be
 .align	16
9b88be
 OPENSSL_instrument_bus:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 	mov	$arg1,$out	# tribute to Win64
9b88be
 	mov	$arg2,$cnt
9b88be
 	mov	$arg2,$max
9b88be
@@ -410,6 +419,7 @@ OPENSSL_instrument_bus:
9b88be
 .align	16
9b88be
 OPENSSL_instrument_bus2:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 	mov	$arg1,$out	# tribute to Win64
9b88be
 	mov	$arg2,$cnt
9b88be
 	mov	$arg3,$max
9b88be
@@ -465,6 +475,7 @@ print<<___;
9b88be
 .align	16
9b88be
 OPENSSL_ia32_${rdop}_bytes:
9b88be
 .cfi_startproc
9b88be
+	endbranch
9b88be
 	xor	%rax, %rax	# return value
9b88be
 	cmp	\$0,$arg2
9b88be
 	je	.Ldone_${rdop}_bytes