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.

That's a highly unlikely sequence of instructions, maybe the kernel
decoder should recognize it as a single instruction.

-- 
Josh

Reply via email to