From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x227Y/zx0YC2ffl1lo37Le7x1MIwTxkmMAdpyzaHqffxha815wm5vu3f4YRbNts7n2CsTKH/s ARC-Seal: i=1; a=rsa-sha256; t=1516611259; cv=none; d=google.com; s=arc-20160816; b=r2BL/2yUtm0NurIfZDBxy3yoUYNbPqOOcH7qtukeoUqAOD4H59j/kN+T1P987TxwdR ZciQWs+/5APwU/FUhAB7GhWcHOtpF3ldhE6wzEvFUU5c9bKHFV+E8VrIuKInNK6bdvg1 OihuxYbQqw/+IDRQ0g46nIuiESjgQzKOmjp6BCtt1Z4ZcfE22zc48qqfS/iiA5nEnRH0 GKKNlQVh9IO59TPM0uIFDVBrspW/yYL1TaGI0jkpEwsDuUdY2LbOpFXFVDyMyGC/bThD NlOikED0TuKUDntw7z8AScRPESYm2892q/hxe5i72cQD0ZZ1q/HaQ+r/o2xptTwBIIXR leoQ== 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=akHkWXjz5/pQ4Nuq+zg9hU4yTuSbJhCsU2r1XvNTpNE=; b=UCMdS4Up9QSu1ev1wJffZNY20qt7XD3man6iZaoj0qRdyj/l0xBSz/zoWV3MRmhLI7 w2f3mdxdPUP8vp+8djZWuzT/hf2FC5uK6jSmxcU1AL33wEjQMQFw+CA0mDM+jpdsAg7x aSd6cqmpvqolDclE+PPU/7cbCQblDOtgqVmLQbVDHU/9gdqByp1feygUd9MiAHWrfiuj ST5mKdyHMPDxfc6/VW24PS/kiVmJluH07CXXGssPXchMeogdQMysoNNXhLs6RSzdJ2pv Q4bgx93HwnVidPYUafIW7J3SkWpj09U2G8mdYxvM6Vx85qooHQULWhH2rlO+1NEpWDnS uW8g== 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.14 82/89] retpoline: Introduce start/end markers of indirect thunk Date: Mon, 22 Jan 2018 09:46:02 +0100 Message-Id: <20180122084002.683758510@linuxfoundation.org> X-Mailer: git-send-email 2.16.0 In-Reply-To: <20180122083954.683903493@linuxfoundation.org> References: <20180122083954.683903493@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?1590282168330550072?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 4.14-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 | 6 ++++++ arch/x86/lib/retpoline.S | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) --- 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 --- 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 --- 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