Re: [PATCH 10/26] x86/tdx: Support TDX guest port I/O at decompression time

From: Borislav Petkov
Date: Wed Jan 19 2022 - 14:46:39 EST


On Wed, Jan 19, 2022 at 06:49:25PM +0300, Kirill A. Shutemov wrote:
> const struct port_io_ops default_pio_ops = {
> .inb = inb,
> .inw = inw,
> .inl = inl,
> .outb = outb,
> .outw = outw,
> .outl = outl,
> };
>
> make pio_ops a pointer and assign it here:
>
> pio_ops = &default_pio_ops;
>
> But it leads to an issue on linking:
>
> ld.lld: error: Unexpected run-time relocations (.rela) detected!

So the above generates absolute relocations of type R_X86_64_64

Relocation section '.rela.data.rel.local' at offset 0x5c18 contains 6 entries:
Offset Info Type Sym. Value Sym. Name + Addend
000000000000 000200000001 R_X86_64_64 0000000000000000 .text + 10
000000000008 000200000001 R_X86_64_64 0000000000000000 .text + 30
000000000010 000200000001 R_X86_64_64 0000000000000000 .text + 50
000000000018 000200000001 R_X86_64_64 0000000000000000 .text + 0
000000000020 000200000001 R_X86_64_64 0000000000000000 .text + 20
000000000028 000200000001 R_X86_64_64 0000000000000000 .text + 40

and the linker doesn't like them probably because of the mcmodel we use
but I need to talk to toolchain folks first to make sense of what's
going on...

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette