All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Avi Kivity <avi@qumranet.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Sam Ravnborg <sam@ravnborg.org>
Subject: [patch] KVM: fix exception entry / build bug, on 64-bit
Date: Mon, 21 Jul 2008 11:09:46 +0200	[thread overview]
Message-ID: <20080721090946.GA3795@elte.hu> (raw)
In-Reply-To: <1216554241-9966-1-git-send-email-avi@qumranet.com>


hi Avi,

* Avi Kivity <avi@qumranet.com> wrote:

>       KVM: Handle virtualization instruction #UD faults during reboot

-tip testing found a build failure on 64-bit x86, caused by this commit. 
Find the fix below.

Thanks,

	Ingo

-------------------->
commit 33a37eb411d193851c334060780ab834ba534292
Author: Ingo Molnar <mingo@elte.hu>
Date:   Mon Jul 21 10:57:15 2008 +0200

    KVM: fix exception entry / build bug, on 64-bit
    
    -tip testing found this build bug:
    
     arch/x86/kvm/built-in.o:(.text.fixup+0x1): relocation truncated to fit: R_X86_64_32 against `.text'
     arch/x86/kvm/built-in.o:(.text.fixup+0xb): relocation truncated to fit: R_X86_64_32 against `.text'
     arch/x86/kvm/built-in.o:(.text.fixup+0x15): relocation truncated to fit: R_X86_64_32 against `.text'
     arch/x86/kvm/built-in.o:(.text.fixup+0x1f): relocation truncated to fit: R_X86_64_32 against `.text'
     arch/x86/kvm/built-in.o:(.text.fixup+0x29): relocation truncated to fit: R_X86_64_32 against `.text'
    
    Introduced by commit 4ecac3fd. The problem is that 'push' will default
    to 32-bit, which is not wide enough as a fixup address. (and which would
    crash on any real fixup event even if it was wide enough)
    
    Introduce KVM_EX_PUSH to get the proper address push width on 64-bit too.
    
    Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 include/asm-x86/kvm_host.h |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/include/asm-x86/kvm_host.h b/include/asm-x86/kvm_host.h
index f995783..fdde0be 100644
--- a/include/asm-x86/kvm_host.h
+++ b/include/asm-x86/kvm_host.h
@@ -703,9 +703,11 @@ enum {
 						vcpu, 0, 0, 0, 0, 0, 0)
 
 #ifdef CONFIG_64BIT
-#define KVM_EX_ENTRY ".quad"
+# define KVM_EX_ENTRY ".quad"
+# define KVM_EX_PUSH "pushq"
 #else
-#define KVM_EX_ENTRY ".long"
+# define KVM_EX_ENTRY ".long"
+# define KVM_EX_PUSH "pushl"
 #endif
 
 /*
@@ -719,7 +721,7 @@ asmlinkage void kvm_handle_fault_on_reboot(void);
 	"666: " insn "\n\t" \
 	".pushsection .text.fixup, \"ax\" \n" \
 	"667: \n\t" \
-	"push $666b \n\t" \
+	KVM_EX_PUSH " $666b \n\t" \
 	"jmp kvm_handle_fault_on_reboot \n\t" \
 	".popsection \n\t" \
 	".pushsection __ex_table, \"a\" \n\t" \

  reply	other threads:[~2008-07-21  9:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-20 11:44 [GIT PULL] KVM Updates for the 2.6.27 merge window Avi Kivity
2008-07-21  9:09 ` Ingo Molnar [this message]
2008-07-21  9:36   ` [patch] KVM: fix exception entry / build bug, on 64-bit Avi Kivity

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=20080721090946.GA3795@elte.hu \
    --to=mingo@elte.hu \
    --cc=avi@qumranet.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.