Skip to content

Commit 33a37eb

Browse files
author
Ingo Molnar
committed
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 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>
1 parent e27772b commit 33a37eb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

include/asm-x86/kvm_host.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -703,9 +703,11 @@ enum {
703703
vcpu, 0, 0, 0, 0, 0, 0)
704704

705705
#ifdef CONFIG_64BIT
706-
#define KVM_EX_ENTRY ".quad"
706+
# define KVM_EX_ENTRY ".quad"
707+
# define KVM_EX_PUSH "pushq"
707708
#else
708-
#define KVM_EX_ENTRY ".long"
709+
# define KVM_EX_ENTRY ".long"
710+
# define KVM_EX_PUSH "pushl"
709711
#endif
710712

711713
/*
@@ -719,7 +721,7 @@ asmlinkage void kvm_handle_fault_on_reboot(void);
719721
"666: " insn "\n\t" \
720722
".pushsection .text.fixup, \"ax\" \n" \
721723
"667: \n\t" \
722-
"push $666b \n\t" \
724+
KVM_EX_PUSH " $666b \n\t" \
723725
"jmp kvm_handle_fault_on_reboot \n\t" \
724726
".popsection \n\t" \
725727
".pushsection __ex_table, \"a\" \n\t" \

0 commit comments

Comments
 (0)