Skip to content

Commit f26e601

Browse files
jpoimboerkrcmar
authored andcommitted
x86/kvm: Move kvm_fastop_exception to .fixup section
When compiling the kernel with the '-frecord-gcc-switches' flag, objtool complains: arch/x86/kvm/emulate.o: warning: objtool: .GCC.command.line+0x0: special: can't find new instruction And also the kernel fails to link. The problem is that the 'kvm_fastop_exception' code gets placed into the throwaway '.GCC.command.line' section instead of '.text'. Exception fixup code is conventionally placed in the '.fixup' section, so put it there where it belongs. Reported-and-tested-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
1 parent a2b7861 commit f26e601

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

arch/x86/kvm/emulate.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,10 @@ static int fastop(struct x86_emulate_ctxt *ctxt, void (*fop)(struct fastop *));
425425
#op " %al \n\t" \
426426
FOP_RET
427427

428-
asm(".global kvm_fastop_exception \n"
429-
"kvm_fastop_exception: xor %esi, %esi; ret");
428+
asm(".pushsection .fixup, \"ax\"\n"
429+
".global kvm_fastop_exception \n"
430+
"kvm_fastop_exception: xor %esi, %esi; ret\n"
431+
".popsection");
430432

431433
FOP_START(setcc)
432434
FOP_SETCC(seto)

0 commit comments

Comments
 (0)