public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: x86@kernel.org
Cc: linux-kernel@vger.kernel.org, Andi Kleen <ak@linux.intel.com>,
	rusty@rustcorp.com.au
Subject: [PATCH 1/7] x86, asmlinkage, lguest: Pass in globals into assembler statement
Date: Tue, 22 Oct 2013 09:07:53 -0700	[thread overview]
Message-ID: <1382458079-24450-2-git-send-email-andi@firstfloor.org> (raw)
In-Reply-To: <1382458079-24450-1-git-send-email-andi@firstfloor.org>

From: Andi Kleen <ak@linux.intel.com>

Tell the compiler that the inline assembler statement
references lguest_entry.

This fixes compile problems with LTO where the variable
and the assembler code may end up in different files.

Cc: x86@kernel.org
Cc: rusty@rustcorp.com.au
Signed-off-by: Andi Kleen <ak@linux.intel.com>
---
 drivers/lguest/x86/core.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/lguest/x86/core.c b/drivers/lguest/x86/core.c
index 5169239..922a1ac 100644
--- a/drivers/lguest/x86/core.c
+++ b/drivers/lguest/x86/core.c
@@ -157,7 +157,7 @@ static void run_guest_once(struct lg_cpu *cpu, struct lguest_pages *pages)
 	 * stack, then the address of this call.  This stack layout happens to
 	 * exactly match the stack layout created by an interrupt...
 	 */
-	asm volatile("pushf; lcall *lguest_entry"
+	asm volatile("pushf; lcall *%4"
 		     /*
 		      * This is how we tell GCC that %eax ("a") and %ebx ("b")
 		      * are changed by this routine.  The "=" means output.
@@ -169,7 +169,9 @@ static void run_guest_once(struct lg_cpu *cpu, struct lguest_pages *pages)
 		      * physical address of the Guest's top-level page
 		      * directory.
 		      */
-		     : "0"(pages), "1"(__pa(cpu->lg->pgdirs[cpu->cpu_pgd].pgdir))
+		     : "0"(pages), 
+		       "1"(__pa(cpu->lg->pgdirs[cpu->cpu_pgd].pgdir)),
+		       "m"(lguest_entry)
 		     /*
 		      * We tell gcc that all these registers could change,
 		      * which means we don't have to save and restore them in
-- 
1.8.3.1


  reply	other threads:[~2013-10-22 16:08 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 ` Andi Kleen [this message]
2013-10-23  0:25   ` [PATCH 1/7] x86, asmlinkage, lguest: Pass in globals into assembler statement 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:x86/asmlinkage] x86, asmlinkage, paravirt: Don' t " tip-bot for Andi Kleen
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=1382458079-24450-2-git-send-email-andi@firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=ak@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=x86@kernel.org \
    /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