Received: by 10.223.185.116 with SMTP id b49csp1121948wrg; Fri, 23 Feb 2018 12:18:25 -0800 (PST) X-Google-Smtp-Source: AH8x227cVdK364qP6YxclnlkvQhUbrfpcCIuBLeWm4dN9gorTjbSeubEyzh0og5UNyfemdZyB+3d X-Received: by 2002:a17:902:4827:: with SMTP id s36-v6mr2768445pld.337.1519417105186; Fri, 23 Feb 2018 12:18:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519417105; cv=none; d=google.com; s=arc-20160816; b=nHBt+Mz0LI2Mex/iIGAGSecFH5jOU8uuou0W98R5Ks82MwjPIV+hmEbKYOz7OEp5WF uOxAq8yyAiMkJxeqo3VvQz4h0z5Es2/4IQUVNT/0bW55HJKWD0hB4X6sOvvwFG6NsEQB mUo+EbdUzDoqeR9AcQZ2uXDCFY2VVO0KPKTn0qJLzWojNGACxUqlKgpuqWEbp1disOBw MuuDep7RxURzt+FTWEv3unPxICP+Eh8oys1kgpvMDjvzsyGKlf7wKIernzsQmHpeag4C xRUyGy+Rd8JLC1sBSqWwmaetW5b0GvDbWS2WH3vROLINfMxwnflg0MCW+dhJ+e4umUK3 TOsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=HK+7Hr6iMvGzsdN8oCW4IDX8O44+e7ZQYnEtUx+XWQM=; b=Y+jUoV1AvUAApEoRd7h1dAjEssfB3urjvAyYaRwcYoNk8Db04sr2VhO+cIhelqXAcj ZNwCWzTC+45EzaJI1icwLguOrlScQVfoGONkzX1C75YE4MSyemLnsYOFNAoTw92eVbiF b3M0lezCGZjyffpqnRuhGPyfxD/kHyscVgVd8mEQ738MH/7+CoeH8tMwSkbdxNxoeKd0 bTrun921eQenLhHtIeHrZI2/mwbJBh30Vo25MwAGm/DsnsztWcpE5i70ULftnA6/Aznw oJofjMuk89sUdK2oSOrNBhv6nHkNx0U8cfvUL0Y1MYSlFSywIul9/P+FdGTb04xfXHqn SERQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u3-v6si2247581plb.72.2018.02.23.12.18.10; Fri, 23 Feb 2018 12:18:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932634AbeBWSk3 (ORCPT + 99 others); Fri, 23 Feb 2018 13:40:29 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:40026 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932615AbeBWSkZ (ORCPT ); Fri, 23 Feb 2018 13:40:25 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 18BC011D0; Fri, 23 Feb 2018 18:40:24 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jeff Law , Waiman Long , Thomas Gleixner , David Woodhouse , Tom Lendacky , Kees Cook , Andi Kleen , Tim Chen , Peter Zijlstra , Linus Torvalds , Jiri Kosina , Andy Lutomirski , Dave Hansen , Josh Poimboeuf , Arjan van de Ven , Paul Turner , Jack Wang , Greg Kroah-Hartman Subject: [PATCH 4.4 165/193] x86/retpoline: Remove the esp/rsp thunk Date: Fri, 23 Feb 2018 19:26:38 +0100 Message-Id: <20180223170351.803060842@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180223170325.997716448@linuxfoundation.org> References: <20180223170325.997716448@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Waiman Long commit 1df37383a8aeabb9b418698f0bcdffea01f4b1b2 upstream. It doesn't make sense to have an indirect call thunk with esp/rsp as retpoline code won't work correctly with the stack pointer register. Removing it will help compiler writers to catch error in case such a thunk call is emitted incorrectly. Fixes: 76b043848fd2 ("x86/retpoline: Add initial retpoline support") Suggested-by: Jeff Law Signed-off-by: Waiman Long Signed-off-by: Thomas Gleixner Acked-by: David Woodhouse Cc: Tom Lendacky Cc: Kees Cook Cc: Andi Kleen Cc: Tim Chen Cc: Peter Zijlstra Cc: Linus Torvalds Cc: Jiri Kosina Cc: Andy Lutomirski Cc: Dave Hansen Cc: Josh Poimboeuf Cc: Arjan van de Ven Cc: Greg Kroah-Hartman Cc: Paul Turner Link: https://lkml.kernel.org/r/1516658974-27852-1-git-send-email-longman@redhat.com Signed-off-by: David Woodhouse [jwang: cherry pick to 4.4] Signed-off-by: Jack Wang Signed-off-by: Greg Kroah-Hartman --- arch/x86/include/asm/asm-prototypes.h | 1 - arch/x86/lib/retpoline.S | 1 - 2 files changed, 2 deletions(-) --- a/arch/x86/include/asm/asm-prototypes.h +++ b/arch/x86/include/asm/asm-prototypes.h @@ -37,5 +37,4 @@ INDIRECT_THUNK(dx) INDIRECT_THUNK(si) INDIRECT_THUNK(di) INDIRECT_THUNK(bp) -INDIRECT_THUNK(sp) #endif /* CONFIG_RETPOLINE */ --- a/arch/x86/lib/retpoline.S +++ b/arch/x86/lib/retpoline.S @@ -36,7 +36,6 @@ GENERATE_THUNK(_ASM_DX) GENERATE_THUNK(_ASM_SI) GENERATE_THUNK(_ASM_DI) GENERATE_THUNK(_ASM_BP) -GENERATE_THUNK(_ASM_SP) #ifdef CONFIG_64BIT GENERATE_THUNK(r8) GENERATE_THUNK(r9)