[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 2/3] x86/svm: Improve diagnostics when svm_get_insn_len() fails



>>> On 17.12.18 at 16:43, <andrew.cooper3@xxxxxxxxxx> wrote:
> On 14/12/2018 10:16, Jan Beulich wrote:
>>>>> On 13.12.18 at 21:22, <andrew.cooper3@xxxxxxxxxx> wrote:
>>> --- a/xen/arch/x86/hvm/svm/emulate.c
>>> +++ b/xen/arch/x86/hvm/svm/emulate.c
>>> @@ -143,8 +143,17 @@ int svm_get_insn_len(struct vcpu *v, enum 
> instruction_index insn)
>>>      }
>>>  
>>>      gdprintk(XENLOG_WARNING,
>>> -             "%s: Mismatch between expected and actual instruction: "
>>> -             "eip = %lx\n",  __func__, (unsigned long)vmcb->rip);
>>> +             "%s: Mismatch between expected and actual instruction:\n",
>>> +             __func__);
>> Is __func__ really useful in a gdprintk()?
> 
> Well - you are the author of that code...

I've touched the neighboring line a while ago, but I didn't add __func__
(and I hardly ever do, due to not finding it helpful in the common case).

>>> +    gdprintk(XENLOG_WARNING,
>>> +             "  insn_index %d, opcode %#x modrm %#x\n",
>>> +             insn, opc_tab[insn].opcode, ((opc_tab[insn].modrm.rm  << 6) |
>>> +                                          (opc_tab[insn].modrm.reg << 3) |
>>> +                                          (opc_tab[insn].modrm.mod)));
>> This is going to be misleading when bit 3 of modrm.reg or modrm.rm
>> are set.
> 
> I'll switch to 0x%02x

How's that going to help? You'd need to print the fields individually.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.