[PATCH 10/12] x86/p6: Prepend X86_NOTRACK to "jmp *%reg"

H.J. Lu hjl.tools at gmail.com
Thu Jan 30 14:08:35 UTC 2020


Since some P6 .asm files uses a trick to implment jump tables with LEA,
prepend X86_NOTRACK to "jmp *%reg" to disable indirect branch tracking
when Intel CET is enabled.

	* mpn/x86/p6/aors_n.asm: Prepend X86_NOTRACK to "jmp *%reg".
	* mpn/x86/p6/aorsmul_1.asm: Likewise.
	* mpn/x86/p6/lshsub_n.asm: Likewise.
	* mpn/x86/p6/mul_basecase.asm: Likewise.
	* mpn/x86/p6/sqr_basecase.asm: Likewise.
---
 mpn/x86/p6/aors_n.asm       | 2 +-
 mpn/x86/p6/aorsmul_1.asm    | 2 +-
 mpn/x86/p6/lshsub_n.asm     | 2 +-
 mpn/x86/p6/mul_basecase.asm | 2 +-
 mpn/x86/p6/sqr_basecase.asm | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/mpn/x86/p6/aors_n.asm b/mpn/x86/p6/aors_n.asm
index b4a32150f..ab172df7e 100644
--- a/mpn/x86/p6/aors_n.asm
+++ b/mpn/x86/p6/aors_n.asm
@@ -90,7 +90,7 @@ L(here):
 ')
 
 	shr	%edx				C set cy flag
-	jmp	*%eax
+	X86_NOTRACK jmp	*%eax
 
 ifdef(`PIC',`
 L(pic_calc):
diff --git a/mpn/x86/p6/aorsmul_1.asm b/mpn/x86/p6/aorsmul_1.asm
index d6bc549e3..2a3b122ee 100644
--- a/mpn/x86/p6/aorsmul_1.asm
+++ b/mpn/x86/p6/aorsmul_1.asm
@@ -240,7 +240,7 @@ L(here):
 	cmovnz(	%ebx, %ecx)	C high,low carry other way around
 	cmovnz(	%eax, %ebx)
 
-	jmp	*%edx
+	X86_NOTRACK jmp	*%edx
 
 
 ifdef(`PIC',`
diff --git a/mpn/x86/p6/lshsub_n.asm b/mpn/x86/p6/lshsub_n.asm
index 2ceb98bd8..17db5d5e0 100644
--- a/mpn/x86/p6/lshsub_n.asm
+++ b/mpn/x86/p6/lshsub_n.asm
@@ -82,7 +82,7 @@ L(here):
 	pxor	%mm1, %mm1
 	pxor	%mm0, %mm0
 
-	jmp	*%eax
+	X86_NOTRACK jmp	*%eax
 
 ifdef(`PIC',`
 L(pic_calc):
diff --git a/mpn/x86/p6/mul_basecase.asm b/mpn/x86/p6/mul_basecase.asm
index 03ae0d6b2..521b31e01 100644
--- a/mpn/x86/p6/mul_basecase.asm
+++ b/mpn/x86/p6/mul_basecase.asm
@@ -524,7 +524,7 @@ L(unroll_outer_entry):
 	xorl	%eax, %ebx		C carries other way for odd index
 	xorl	%eax, %ecx
 
-	jmp	*%edx
+	X86_NOTRACK jmp	*%edx
 
 
 C -----------------------------------------------------------------------------
diff --git a/mpn/x86/p6/sqr_basecase.asm b/mpn/x86/p6/sqr_basecase.asm
index ca29e8084..f71304f39 100644
--- a/mpn/x86/p6/sqr_basecase.asm
+++ b/mpn/x86/p6/sqr_basecase.asm
@@ -447,7 +447,7 @@ define(cmovX,`ifelse(eval(UNROLL_COUNT%2),1,`cmovz($@)',`cmovnz($@)')')
 	cmovX(	%ebx, %ecx)	C high carry reverse
 	cmovX(	%eax, %ebx)	C low carry reverse
 	movl	%edx, VAR_JMP
-	jmp	*%edx
+	X86_NOTRACK jmp	*%edx
 
 
 	C Must be on an even address here so the low bit of the jump address
-- 
2.24.1



More information about the gmp-devel mailing list