From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x224aj4xXszvKeVhQV71jMEuEMRYYoRQsB03baMpTJGuL39HQNiyveeMuRIvNybmmRByHwojU ARC-Seal: i=1; a=rsa-sha256; t=1516610567; cv=none; d=google.com; s=arc-20160816; b=qX0iDjGAkiBIRVJ9EYdHaRzhAegnnX5P9g0iT08l1CTPuUhIbZrWue4Q4PdK6PR4ZD GSKhS/pqpbpCZlTlR08lC7+/BgywihAcCTO4wOGA9Qn89bgQDtACB5ZKOuiHeAAoc17M gcw3Er4S4ynZ0ByiHap4WdjZTbExoZmweZTBTQsboNTn/L+MWtyjHpB2TPWRvthzTR8X LXX1GcKkVd1cqD5kX+A8rsBLXnssOnLF6nrDJiLLn0nCv2N8z267bsKHDGFbjoystf9w IBrpEsGTQbiBPL6Bp0TztSIaLwnbXzCj9gZtoGV1FGpD447gNOMtHyHAsIo8ECFjRyMu sBTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=j41SKYEZSlgNwyS44zH3/RZqF37+uyseDusmLPVYOzE=; b=rm4Bo+1D2IDloPJYhRovzFtlZVv4p1QgkW14t04G8lh7/qTZhLc2/fjkC1HuXV93rs AS9Cun80jp47NGPfHkaZNoPABmuC+Vj1ZMmJ41yunhZTvwH7+7LUcpJg0o+L5JkKIY+q 9/0jMYnsuu6W+iXr5pjNlcx53HZFRJfj4IN7SU7idUVpDMEsFTKSl5CJMO3IfVUVwkCQ 6Kh5j6uwBew01ZkEaz6lo6GhfmBQ4LF5+I37A4d4c3Asd1bJSbta4kr3Qe+fhrWzTjjg KggGCBycf4CyLpmV+zYe24D95pwh1KJowF3T9ZbjT/jCB7ag91wJckab6/WDZQ4zvWoO 7C+g== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masami Hiramatsu , Thomas Gleixner , David Woodhouse , Andi Kleen , Peter Zijlstra , Ananth N Mavinakayanahalli , Arjan van de Ven , Greg Kroah-Hartman Subject: [PATCH 4.4 49/53] retpoline: Introduce start/end markers of indirect thunk Date: Mon, 22 Jan 2018 09:40:41 +0100 Message-Id: <20180122083912.717880760@linuxfoundation.org> X-Mailer: git-send-email 2.16.0 In-Reply-To: <20180122083910.299610926@linuxfoundation.org> References: <20180122083910.299610926@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-LABELS: =?utf-8?b?IlxcU2VudCI=?= X-GMAIL-THRID: =?utf-8?q?1590281441648797154?= X-GMAIL-MSGID: =?utf-8?q?1590281441648797154?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Masami Hiramatsu commit 736e80a4213e9bbce40a7c050337047128b472ac upstream. 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 Link: https://lkml.kernel.org/r/151629206178.10241.6828804696410044771.stgit@devbox Signed-off-by: Greg Kroah-Hartman --- arch/x86/include/asm/nospec-branch.h | 3 +++ arch/x86/kernel/vmlinux.lds.S | 7 +++++++ arch/x86/lib/retpoline.S | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) --- a/arch/x86/include/asm/nospec-branch.h +++ b/arch/x86/include/asm/nospec-branch.h @@ -171,6 +171,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 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S @@ -104,6 +104,13 @@ SECTIONS IRQENTRY_TEXT *(.fixup) *(.gnu.warning) + +#ifdef CONFIG_RETPOLINE + __indirect_thunk_start = .; + *(.text.__x86.indirect_thunk) + __indirect_thunk_end = .; +#endif + /* End of text section */ _etext = .; } :text = 0x9090 --- 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