From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: ACJfBosai+rROPuzUxiQ1KxzKSoG9Ks8sEIim+BDHvB6E2i3AT/xJXrVPDYw5VNV1I0sizauOCOW ARC-Seal: i=1; a=rsa-sha256; t=1516377089; cv=none; d=google.com; s=arc-20160816; b=yBp074cCa21oVHNLuxkD71eaY45HpyV4DaEp5X7P4GSfRIiAlAF1LcYGkKenz8AvpD hBbgdUI9lHbg8p34nzi1VeQ288RnCwjZfiDHlrR3Mh4X8vbZ7xVptHsmJg9lsaOI1O4M vtbcoeNgnkN7CpB2mEmHUbBPuEyP978pXaMLfLmUpBjxwDMYKqAR0zyxfHCqo8HKmhzt RxbRHAd1a8U6fcjlukCK7vP97beBbp4IUFvNbJudz16ewcocUK0ptl9EOLk7USJn7W4b CJyRzIfMdMn0LrjTSVoLv/X+7vYVxYALMaztLBk1+TVEsqKNxvEClL/ZLS764goUw+eT ilZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=precedence:content-disposition:content-transfer-encoding :mime-version:robot-unsubscribe:robot-id:git-commit-id:subject:to :references:in-reply-to:reply-to:cc:message-id:from:sender:date :arc-authentication-results; bh=u2PLvA+RhQLukj1TR3HDx+RG0S+Ke2CBaj0xNfgDDZQ=; b=JDkI+gf/sGL7tSjmxN0a2Loaug17Tz+a/VUFb6GwNXZIO5cXGu5ePc4CbFf5gwm3yG fFTv8tyy7bu7HNtenlEevK1ver4Q483HhmyLelY306C4FHJ/yLmDNMgrKpggYSIbz1i4 2N85r5OhNto1x4hzR2O/jY+kF5PoMMtADgTLGunNaEIhpzsMoXbMroVC3R8lv0qt0hlx ojf2fwXDj9gblG0/rzXTpkrahnVad6cOCRTZCDnnRNo2sznbXuvsoZ/05YQ9Dt5Un6qC tkrnWInAqo2jXKFF9JJ+lBcC9lkly7xIHerbEVkTOoD94EFPgoMU6ldPhCO7qGWRvjM0 V2Ew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of tipbot@zytor.com designates 65.50.211.136 as permitted sender) smtp.mailfrom=tipbot@zytor.com Authentication-Results: mx.google.com; spf=pass (google.com: domain of tipbot@zytor.com designates 65.50.211.136 as permitted sender) smtp.mailfrom=tipbot@zytor.com Date: Fri, 19 Jan 2018 07:47:22 -0800 Sender: tip tree robot From: tip-bot for Masami Hiramatsu Message-ID: Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, ak@linux.intel.com, ananth@linux.vnet.ibm.com, tglx@linutronix.de, gregkh@linux-foundation.org, mingo@kernel.org, hpa@zytor.com, dwmw@amazon.co.uk, mhiramat@kernel.org, arjan@linux.intel.com Reply-To: ak@linux.intel.com, peterz@infradead.org, linux-kernel@vger.kernel.org, ananth@linux.vnet.ibm.com, gregkh@linux-foundation.org, tglx@linutronix.de, arjan@linux.intel.com, mhiramat@kernel.org, dwmw@amazon.co.uk, hpa@zytor.com, mingo@kernel.org In-Reply-To: <151629206178.10241.6828804696410044771.stgit@devbox> References: <151629206178.10241.6828804696410044771.stgit@devbox> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/pti] retpoline: Introduce start/end markers of indirect thunk Git-Commit-ID: 736e80a4213e9bbce40a7c050337047128b472ac X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1589931570462984334?= X-GMAIL-MSGID: =?utf-8?q?1590036623088183212?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: Commit-ID: 736e80a4213e9bbce40a7c050337047128b472ac Gitweb: https://git.kernel.org/tip/736e80a4213e9bbce40a7c050337047128b472ac Author: Masami Hiramatsu AuthorDate: Fri, 19 Jan 2018 01:14:21 +0900 Committer: Thomas Gleixner CommitDate: Fri, 19 Jan 2018 16:31:28 +0100 retpoline: Introduce start/end markers of indirect thunk Introduce start/end markers of __x86_indirect_thunk_* functions. To make it easy, consolidate .text.__x86.indirect_thunk.* sections to one .text.__x86.indirect_thunk section and put it in the end of kernel text section and adds __indirect_thunk_start/end so that other subsystem (e.g. kprobes) can identify it. Signed-off-by: Masami Hiramatsu Signed-off-by: Thomas Gleixner Acked-by: David Woodhouse Cc: Andi Kleen Cc: Peter Zijlstra Cc: Ananth N Mavinakayanahalli Cc: Arjan van de Ven Cc: Greg Kroah-Hartman Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/151629206178.10241.6828804696410044771.stgit@devbox --- arch/x86/include/asm/nospec-branch.h | 3 +++ arch/x86/kernel/vmlinux.lds.S | 6 ++++++ arch/x86/lib/retpoline.S | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h index 7b45d84..19ba5ad 100644 --- a/arch/x86/include/asm/nospec-branch.h +++ b/arch/x86/include/asm/nospec-branch.h @@ -194,6 +194,9 @@ enum spectre_v2_mitigation { SPECTRE_V2_IBRS, }; +extern char __indirect_thunk_start[]; +extern char __indirect_thunk_end[]; + /* * On VMEXIT we must ensure that no RSB predictions learned in the guest * can be followed in the host, by overwriting the RSB completely. Both diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index 1e413a93..9b138a0 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S @@ -124,6 +124,12 @@ SECTIONS ASSERT(. - _entry_trampoline == PAGE_SIZE, "entry trampoline is too big"); #endif +#ifdef CONFIG_RETPOLINE + __indirect_thunk_start = .; + *(.text.__x86.indirect_thunk) + __indirect_thunk_end = .; +#endif + /* End of text section */ _etext = .; } :text = 0x9090 diff --git a/arch/x86/lib/retpoline.S b/arch/x86/lib/retpoline.S index cb45c6c..d3415dc 100644 --- a/arch/x86/lib/retpoline.S +++ b/arch/x86/lib/retpoline.S @@ -9,7 +9,7 @@ #include .macro THUNK reg - .section .text.__x86.indirect_thunk.\reg + .section .text.__x86.indirect_thunk ENTRY(__x86_indirect_thunk_\reg) CFI_STARTPROC