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: linux-kernel@vger.kernel.org, jeremy@goop.org, hpa@zytor.com,
	mingo@kernel.org, ak@linux.intel.com, tglx@linutronix.de,
	hpa@linux.intel.com
Subject: [tip:x86/asmlinkage] x86, asmlinkage, paravirt: Don' t rely on local assembler labels
Date: Wed, 29 Jan 2014 22:21:40 -0800	[thread overview]
Message-ID: <tip-824a2870098fa5364d49d4cd5a1f41544d9f6c65@git.kernel.org> (raw)
In-Reply-To: <1382458079-24450-4-git-send-email-andi@firstfloor.org>

Commit-ID:  824a2870098fa5364d49d4cd5a1f41544d9f6c65
Gitweb:     http://git.kernel.org/tip/824a2870098fa5364d49d4cd5a1f41544d9f6c65
Author:     Andi Kleen <ak@linux.intel.com>
AuthorDate: Tue, 22 Oct 2013 09:07:55 -0700
Committer:  H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Wed, 29 Jan 2014 22:17:17 -0800

x86, asmlinkage, paravirt: Don't rely on local assembler labels

The paravirt patching code assumes that it can reference a
local assembler label between two different top level assembler
statements. This does not work with LTO
where the assembler code may end up in different assembler files.

Replace it with extern / global /asm linkage labels.

This also removes one redundant copy of the macro.

Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Link: http://lkml.kernel.org/r/1382458079-24450-4-git-send-email-andi@firstfloor.org
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
 arch/x86/include/asm/paravirt_types.h | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
index aab8f67..7549b8b 100644
--- a/arch/x86/include/asm/paravirt_types.h
+++ b/arch/x86/include/asm/paravirt_types.h
@@ -388,10 +388,11 @@ extern struct pv_lock_ops pv_lock_ops;
 	_paravirt_alt(insn_string, "%c[paravirt_typenum]", "%c[paravirt_clobber]")
 
 /* Simple instruction patching code. */
-#define DEF_NATIVE(ops, name, code) 					\
-	extern const char start_##ops##_##name[] __visible,		\
-			  end_##ops##_##name[] __visible;		\
-	asm("start_" #ops "_" #name ": " code "; end_" #ops "_" #name ":")
+#define NATIVE_LABEL(a,x,b) "\n\t.globl " a #x "_" #b "\n" a #x "_" #b ":\n\t"
+
+#define DEF_NATIVE(ops, name, code)					\
+	__visible extern const char start_##ops##_##name[], end_##ops##_##name[];	\
+	asm(NATIVE_LABEL("start_", ops, name) code NATIVE_LABEL("end_", ops, name))
 
 unsigned paravirt_patch_nop(void);
 unsigned paravirt_patch_ident_32(void *insnbuf, unsigned len);

  reply	other threads:[~2014-01-30  6:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-22 16:07 Various more LTO fixes for x86 Andi Kleen
2013-10-22 16:07 ` [PATCH 1/7] x86, asmlinkage, lguest: Pass in globals into assembler statement Andi Kleen
2013-10-23  0:25   ` Rusty Russell
2013-10-22 16:07 ` [PATCH 2/7] x86, asmlinkage, lguest: Fix C functions used by inline assembler Andi Kleen
2013-10-23  0:26   ` Rusty Russell
2014-01-30  6:21   ` [tip:x86/asmlinkage] " tip-bot for Andi Kleen
2013-10-22 16:07 ` [PATCH 3/7] x86, asmlinkage, paravirt: Don't rely on local assembler labels Andi Kleen
2014-01-30  6:21   ` tip-bot for Andi Kleen [this message]
2013-10-22 16:07 ` [PATCH 4/7] x86, asmlinkage, paravirt: Make paravirt thunks global v2 Andi Kleen
2014-01-30  6:21   ` [tip:x86/asmlinkage] x86, asmlinkage, paravirt: Make paravirt thunks global tip-bot for Andi Kleen
2013-10-22 16:07 ` [PATCH 5/7] x86: Use inline assembler instead of global register variable to get sp v2 Andi Kleen
2014-01-30  6:22   ` [tip:x86/asmlinkage] x86: Use inline assembler instead of global register variable to get sp tip-bot for Andi Kleen
2013-10-22 16:07 ` [PATCH 6/7] x86, asmlinkage, xen, kvm: Make {xen,kvm}_lock_spinning global and visible Andi Kleen
2013-10-30  9:28   ` Gleb Natapov
2014-01-30  6:22   ` [tip:x86/asmlinkage] x86, asmlinkage, xen, kvm: Make {xen, kvm}_lock_spinning " tip-bot for Andi Kleen
2013-10-22 16:07 ` [PATCH 7/7] x86, asmlinkage, xen: Fix type of nmi Andi Kleen
2014-01-30  6:22   ` [tip:x86/asmlinkage] x86, asmlinkage, xen: Fix type of NMI tip-bot for Andi Kleen

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-824a2870098fa5364d49d4cd5a1f41544d9f6c65@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=ak@linux.intel.com \
    --cc=hpa@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jeremy@goop.org \
    --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).