Re: [tip:x86/seves] BUILD SUCCESS WITH WARNING e6eb15c9ba3165698488ae5c34920eea20eaa38e

Josh Poimboeuf
2020-09-15T21:04:47Z

On Tue, Sep 15, 2020 at 10:49:12PM +0200, Borislav Petkov wrote:
> On Tue, Sep 15, 2020 at 01:12:24PM -0700, Nick Desaulniers wrote:
> > 1 warning: objtool: ist_exc_vmm_communication()+0x12: unreachable instruction
>
> That looks interesting. So your .o has:
>
> 00000000000004c0 <ist_exc_vmm_communication>:
> 4c0: 55 push %rbp
> 4c1: 48 89 e5 mov %rsp,%rbp
> 4c4: 48 c7 c7 00 00 00 00 mov $0x0,%rdi
> 4cb: 31 c0 xor %eax,%eax
> 4cd: e8 00 00 00 00 callq 4d2 <ist_exc_vmm_communication+0x12>
> 4d2: 0f 0b ud2
> 4d4: 66 66 2e 0f 1f 84 00 data16 nopw %cs:0x0(%rax,%rax,1)
> 4db: 00 00 00 00
> 4df: 90 nop

If you disassemble with "objdump -dr" it shows the relocations:

00000000000004c0 <ist_exc_vmm_communication>:
4c0: 55 push %rbp
4c1: 48 89 e5 mov %rsp,%rbp
4c4: 48 c7 c7 00 00 00 00 mov $0x0,%rdi
4c7: R_X86_64_32S .rodata.str1.1+0x1ef
4cb: 31 c0 xor %eax,%eax
4cd: e8 00 00 00 00 callq 4d2 <ist_exc_vmm_communication+0x12>
4ce: R_X86_64_PLT32 panic-0x4
4d2: 0f 0b ud2
4d4: 66 66 2e 0f 1f 84 00 data16 nopw %cs:0x0(%rax,%rax,1)
4db: 00 00 00 00
4df: 90 nop

panic() is noreturn, so the compiler is enforcing the fact that it
doesn't return, by trapping if it does return.

I seem to remember that's caused by CONFIG_UBSAN_TRAP.

--
Josh