[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200915204912.GA14436@zn.tnic>
Date: Tue, 15 Sep 2020 22:49:12 +0200
From: Borislav Petkov <bp@...en8.de>
To: Nick Desaulniers <ndesaulniers@...gle.com>
Cc: Josh Poimboeuf <jpoimboe@...hat.com>,
Rong Chen <rong.a.chen@...el.com>,
kernel test robot <lkp@...el.com>,
"Li, Philip" <philip.li@...el.com>, x86-ml <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
clang-built-linux <clang-built-linux@...glegroups.com>,
Marco Elver <elver@...gle.com>
Subject: Re: [tip:x86/seves] BUILD SUCCESS WITH WARNING
e6eb15c9ba3165698488ae5c34920eea20eaa38e
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
And the unreachable insn is at 0x4d2. The version I got when building with
clang12 built from git of today is:
00000000000003e0 <ist_exc_vmm_communication>:
3e0: 55 push %rbp
3e1: 48 89 e5 mov %rsp,%rbp
3e4: 48 c7 c7 00 00 00 00 mov $0x0,%rdi
3eb: 31 c0 xor %eax,%eax
3ed: e8 00 00 00 00 callq 3f2 <ist_exc_vmm_communication+0x12>
3f2: 66 66 2e 0f 1f 84 00 data16 nopw %cs:0x0(%rax,%rax,1)
3f9: 00 00 00 00
3fd: 0f 1f 00 nopl (%rax)
and that version is calling a bunch of NOPs.
gcc produces:
00000000000002aa <ist_exc_vmm_communication>:
2aa: 55 push %rbp
2ab: 48 c7 c7 00 00 00 00 mov $0x0,%rdi
2b2: 48 89 e5 mov %rsp,%rbp
2b5: e8 00 00 00 00 callq 2ba <ist_exc_vmm_communication+0x10>
2ba: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1)
(Btw, clang doesn't need to add that "xor %eax,%eax" - panic() should not be
returning, ever. :-))
So what that call actually is, is:
# arch/x86/kernel/sev-es.c:1342: panic("Can't handle #VC exception from unsupported context\n");
call panic #
and the address of panic() gets fixed up by the linker into:
ffffffff83066dca <ist_exc_vmm_communication>:
ffffffff83066dca: 55 push %rbp
ffffffff83066dcb: 48 c7 c7 08 4f e2 83 mov $0xffffffff83e24f08,%rdi
ffffffff83066dd2: 48 89 e5 mov %rsp,%rbp
ffffffff83066dd5: e8 52 23 ff ff callq ffffffff8305912c <panic>
ffffffff83066dda: 66 0f 1f 44 00 00 nopw 0x0(%rax,%rax,1)
But your compiler generates a call to UD2.
Interesting.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists