From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x2255pFouP8osR+YcfTVdN9W3Rksi/3reoN7yl7mNYxpVCkKQZybBmJHOQDAaWal5aS0Kuso8 ARC-Seal: i=1; a=rsa-sha256; t=1516610961; cv=none; d=google.com; s=arc-20160816; b=PlDrh3FjXu8x7nLqgZIov/aKmvgOnb5niKmm5fUbzM5LuSMm9RnYsbLDO0r5b1u4jE uQSzcE/0cEkd6demn3fmcr25MT+asQDQy1Lz5XiM7W25AXSSGOFWKDvs9ubpFnTL/mjB g5/illkAWXGHGkN0YvklNYFYA1y7bfE0JuqPye0ukJWJ9Qd4wSiRINqlVfOQsFXxg1i8 IZhe3M4RtSaUF9B0+uD8qp/hrwO/k2rKWqDt6+VgrrSSRSagEpbozZihFdCv4RvPIxAm TDH5F0MV0VhlmhrHdRBvCxYbBNSJHayPRW69GgYjzaP/fpvqxy/3wDYWe3Ea4iCyqU38 S/ZQ== 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=dnpi9vXqb68VPMkWkaLMogCS37p2A+wG/NsxMSCi7qk=; b=jr9fa8jo7oiAFIxJcQlcBGesB9BuBH4LnmYipZ9yDjiMkH03fPQz3wfIt3B+scWlvU KiL8uVyYkR4JsPw90qZj/D7sjepCNgDLMThM44fyxdCQJrBqc4KTRKlJJNl1mJiER9AM wSG86pUXezxfhO1t/HoAnnuyqVun2+Zd0GRx+PDSfj6J0GFIdZcpi1LHEeSIJbaGN9SN 9g9d243WDFMEYx7CMkOTXyRt0c76a4tVvfJKIwwG13O3oJRGr6S0mZDlK4GcJeXkCfSY U99PSKk2ISIhqFFK1mwW1roW/XebXIYvsxajADhmWlO//s2sH1IL7b7k6sZ0nfryNkG+ 9fTA== 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.9 43/47] retpoline: Introduce start/end markers of indirect thunk Date: Mon, 22 Jan 2018 09:45:54 +0100 Message-Id: <20180122083928.744239769@linuxfoundation.org> X-Mailer: git-send-email 2.16.0 In-Reply-To: <20180122083925.568134913@linuxfoundation.org> References: <20180122083925.568134913@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?1590281855113318439?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 4.9-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 @@ -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 @@ -105,6 +105,13 @@ SECTIONS SOFTIRQENTRY_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