Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752162AbeADCAx (ORCPT + 1 other); Wed, 3 Jan 2018 21:00:53 -0500 Received: from mga07.intel.com ([134.134.136.100]:37434 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752056AbeADCAr (ORCPT ); Wed, 3 Jan 2018 21:00:47 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,505,1508828400"; d="scan'208";a="8291987" From: Andi Kleen To: tglx@linutronix.de Cc: torvalds@linux-foundation.org, gregkh@linux-foundation.org, linux-kernel@vger.kernel.org, tim.c.chen@linux.intel.com, Andi Kleen Subject: [PATCH v2 07/12] x86/retpoline/checksum32: Convert assembler indirect jumps Date: Wed, 3 Jan 2018 18:00:14 -0800 Message-Id: <20180104020019.1173-8-andi@firstfloor.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180104020019.1173-1-andi@firstfloor.org> References: <20180104020019.1173-1-andi@firstfloor.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: From: Andi Kleen Convert all indirect jumps in 32bit checksum assembler code to use non speculative sequences. Based on code from David Woodhouse and Tim Chen Signed-off-by: Andi Kleen --- arch/x86/lib/checksum_32.S | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/lib/checksum_32.S b/arch/x86/lib/checksum_32.S index 4d34bb548b41..d19862183d4b 100644 --- a/arch/x86/lib/checksum_32.S +++ b/arch/x86/lib/checksum_32.S @@ -29,6 +29,7 @@ #include #include #include +#include /* * computes a partial checksum, e.g. for TCP/UDP fragments @@ -156,7 +157,7 @@ ENTRY(csum_partial) negl %ebx lea 45f(%ebx,%ebx,2), %ebx testl %esi, %esi - jmp *%ebx + NOSPEC_JMP %ebx # Handle 2-byte-aligned regions 20: addw (%esi), %ax @@ -439,7 +440,7 @@ ENTRY(csum_partial_copy_generic) andl $-32,%edx lea 3f(%ebx,%ebx), %ebx testl %esi, %esi - jmp *%ebx + NOSPEC_JMP %ebx 1: addl $64,%esi addl $64,%edi SRC(movb -32(%edx),%bl) ; SRC(movb (%edx),%bl) -- 2.14.3