Re: [PATCH v3 04/26] x86/kexec: Use RIP relative addressing

From: Miroslav Benes
Date: Wed Mar 25 2020 - 05:34:57 EST


On Tue, 24 Mar 2020, Peter Zijlstra wrote:

> Normally identity_mapped is not visible to objtool, due to:
>
> arch/x86/kernel/Makefile:OBJECT_FILES_NON_STANDARD_relocate_kernel_$(BITS).o := y
>
> However, when we want to run objtool on vmlinux.o there is no hiding
> it:
>
> vmlinux.o: warning: objtool: .text+0x4c0f1: unsupported intra-function call
>
> Replace the (i386 inspired) pattern:
>
> call 1f
> 1: popq %r8
> subq $(1b - relocate_kernel), %r8
>
> With a x86_64 RIP-relative LEA:
>
> leaq relocate_kernel(%rip), %r8
>
> Suggested-by: Brian Gerst <brgerst@xxxxxxxxx>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
> Acked-by: Josh Poimboeuf <jpoimboe@xxxxxxxxxx>

Reviewed-by: Miroslav Benes <mbenes@xxxxxxx>

M