[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190829105356.1fd4859f49c142945146855f@kernel.org>
Date: Thu, 29 Aug 2019 10:53:56 +0900
From: Masami Hiramatsu <mhiramat@...nel.org>
To: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: Stephen Rothwell <sfr@...b.auug.org.au>,
Linux Next Mailing List <linux-next@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>,
Randy Dunlap <rdunlap@...radead.org>
Subject: Re: linux-next: Tree for Aug 27 (objtool)
Hi Josh,
On Wed, 28 Aug 2019 11:34:33 -0500
Josh Poimboeuf <jpoimboe@...hat.com> wrote:
> On Wed, Aug 28, 2019 at 11:13:31AM -0500, Josh Poimboeuf wrote:
> > Turns out this patch does break something:
> >
> > arch/x86/xen/enlighten_pv.o: warning: objtool: xen_cpuid()+0x25: can't find jump dest instruction at .text+0x9c
> >
> > I'll need to figure out a better way to whitelist that
> > XEN_EMULATE_PREFIX fake instruction thing. I'll probably just teach
> > the objtool decoder about it.
>
> Hi Masami,
>
> Is it possible for the kernel x86 decoder to recognize the
> XEN_EMULATE_PREFIX prefix?
>
> asm(XEN_EMULATE_PREFIX "cpuid"
> : "=a" (*ax),
> "=b" (*bx),
> "=c" (*cx),
> "=d" (*dx)
> : "0" (*ax), "2" (*cx));
>
> is disassembled to:
>
> 33: 0f 0b ud2
> 35: 78 65 js 9c <xen_store_tr+0xc>
> 37: 6e outsb %ds:(%rsi),(%dx)
> 38: 0f a2 cpuid
>
> which confuses objtool. Presumably that would confuse other users of
> the decoder as well.
Good catch! It should be problematic, since x86 decoder sanity test is
based on objtool. But I don't want to change the test code itself,
because this problem is highly depending on Xen.
> That's a highly unlikely sequence of instructions, maybe the kernel
> decoder should recognize it as a single instruction.
OK, it is better to be done in decoder (only for CONFIG_XEN_PVHVM)
BTW, could you also share what test case would you using?
And what about attached patch? (just compile checked with/without CONFIG_XEN_PVHVM)
Thank you,
--
Masami Hiramatsu <mhiramat@...nel.org>
View attachment "0001-x86-xen-insn-Decode-XEN_EMULATE_PREFIX-correctly.patch" of type "text/x-diff" (3406 bytes)
Powered by blists - more mailing lists