linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Andi Kleen <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: mingo@kernel.org, hpa@zytor.com, tglx@linutronix.de,
	ak@linux.intel.com, linux-kernel@vger.kernel.org
Subject: [tip:x86/asm] x86/asm: Mark all top level asm statements as .text
Date: Fri, 19 Apr 2019 08:52:06 -0700	[thread overview]
Message-ID: <tip-c03e27506a564ec7db1b179e7464835901f49751@git.kernel.org> (raw)
In-Reply-To: <20190330004743.29541-1-andi@firstfloor.org>

Commit-ID:  c03e27506a564ec7db1b179e7464835901f49751
Gitweb:     https://git.kernel.org/tip/c03e27506a564ec7db1b179e7464835901f49751
Author:     Andi Kleen <ak@linux.intel.com>
AuthorDate: Fri, 29 Mar 2019 17:47:35 -0700
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Fri, 19 Apr 2019 17:46:55 +0200

x86/asm: Mark all top level asm statements as .text

With gcc toplevel assembler statements that do not mark themselves as .text
may end up in other sections. This causes LTO boot crashes because various
assembler statements ended up in the middle of the initcall section. It's
also a latent problem without LTO, although it's currently not known to
cause any real problems.

According to the gcc team it's expected behavior.

Always mark all the top level assembler statements as text so that they
switch to the right section.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/20190330004743.29541-1-andi@firstfloor.org

---
 arch/x86/kernel/cpu/amd.c      | 3 ++-
 arch/x86/kernel/kprobes/core.c | 1 +
 arch/x86/lib/error-inject.c    | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 01004bfb1a1b..1bcb489e07e7 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -83,7 +83,8 @@ static inline int wrmsrl_amd_safe(unsigned msr, unsigned long long val)
  */
 
 extern __visible void vide(void);
-__asm__(".globl vide\n"
+__asm__(".text\n"
+	".globl vide\n"
 	".type vide, @function\n"
 	".align 4\n"
 	"vide: ret\n");
diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
index a034cb808e7e..31ab91c9c4e9 100644
--- a/arch/x86/kernel/kprobes/core.c
+++ b/arch/x86/kernel/kprobes/core.c
@@ -715,6 +715,7 @@ NOKPROBE_SYMBOL(kprobe_int3_handler);
  * calls trampoline_handler() runs, which calls the kretprobe's handler.
  */
 asm(
+	".text\n"
 	".global kretprobe_trampoline\n"
 	".type kretprobe_trampoline, @function\n"
 	"kretprobe_trampoline:\n"
diff --git a/arch/x86/lib/error-inject.c b/arch/x86/lib/error-inject.c
index 3cdf06128d13..be5b5fb1598b 100644
--- a/arch/x86/lib/error-inject.c
+++ b/arch/x86/lib/error-inject.c
@@ -6,6 +6,7 @@
 asmlinkage void just_return_func(void);
 
 asm(
+	".text\n"
 	".type just_return_func, @function\n"
 	".globl just_return_func\n"
 	"just_return_func:\n"

      parent reply	other threads:[~2019-04-19 19:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-30  0:47 [PATCH v2 1/9] x86/asm: Mark all top level asm statements as .text Andi Kleen
2019-03-30  0:47 ` [PATCH v2 2/9] x86/cpu/amd: Ifdef 32bit only assembler for 32bit Andi Kleen
2019-04-19 15:52   ` [tip:x86/asm] x86/cpu/amd: Exclude 32bit only assembler from 64bit build tip-bot for Andi Kleen
2019-03-30  0:47 ` [PATCH v2 3/9] x86/paravirt: Replace paravirt patches with data Andi Kleen
2019-04-19 21:26   ` Thomas Gleixner
2019-03-30  0:47 ` [PATCH v2 4/9] x86/timer: Don't inline __const_udelay Andi Kleen
2019-04-19 15:55   ` [tip:x86/timers] x86/timer: Don't inline __const_udelay() tip-bot for Andi Kleen
2019-03-30  0:47 ` [PATCH v2 5/9] x86/xen: Mark xen_vcpu_stolen as __visible Andi Kleen
2019-03-30 10:40   ` Juergen Gross
2019-03-30  0:47 ` [PATCH v2 6/9] x86/hyperv: Make hv_vcpu_is_preempted visible Andi Kleen
2019-04-19 15:58   ` [tip:x86/hyperv] x86/hyperv: Make hv_vcpu_is_preempted() visible tip-bot for Andi Kleen
2019-04-19 16:04   ` [tip:x86/platform] " tip-bot for Andi Kleen
2019-03-30  0:47 ` [PATCH v2 7/9] x86/kprobes: Make trampoline_handler global and visible Andi Kleen
2019-04-19 15:58   ` [tip:x86/core] x86/kprobes: Make trampoline_handler() " tip-bot for Andi Kleen
2019-05-08 11:20   ` [tip:x86/urgent] " tip-bot for Andi Kleen
2019-03-30  0:47 ` [PATCH v2 8/9] x86/kvm: Make steal_time visible Andi Kleen
2019-04-19 16:04   ` [tip:x86/platform] " tip-bot for Andi Kleen
2019-03-30  0:47 ` [PATCH v2 9/9] x86/cpu/bugs: Fix __initconst usage in bugs.c Andi Kleen
2019-04-19 15:16   ` [tip:x86/urgent] x86/cpu/bugs: Use __initconst for 'const' init data tip-bot for Andi Kleen
2019-04-19 15:52 ` tip-bot for Andi Kleen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-c03e27506a564ec7db1b179e7464835901f49751@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=ak@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).