Skip to content

Commit

Permalink
KVM: fix exception entry / build bug, on 64-bit
Browse files Browse the repository at this point in the history
-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 4ecac3f. 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>
  • Loading branch information
Ingo Molnar committed Jul 21, 2008
1 parent e27772b commit 33a37eb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions include/asm-x86/kvm_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

/*
Expand All @@ -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" \
Expand Down

0 comments on commit 33a37eb

Please sign in to comment.