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

Re: [Xen-devel] [PATCH v4 10/12] fuzz/x86_emulate: Add --rerun option to try to track down instability



>>> On 13.10.17 at 11:43, <george.dunlap@xxxxxxxxxx> wrote:
> On 10/12/2017 04:24 PM, Jan Beulich wrote:
>>>>> On 11.10.17 at 19:52, <george.dunlap@xxxxxxxxxx> wrote:
>>> +        if ( memcmp(&state[0].regs, &state[1].regs, sizeof(state[0].regs)) 
>>> )
>>> +        {
>>> +            printf("registers differ!\n");
>>> +            /* Print If Not Equal */
>>> +#define PRINT_NE(elem)\
>>> +            if ( state[0].elem != state[1].elem ) \
>>> +                printf(#elem " differ: %lx != %lx\n", \
>>> +                       (unsigned long)state[0].elem, \
>>> +                       (unsigned long)state[1].elem)
>>> +            PRINT_NE(regs.r15);
>>> +            PRINT_NE(regs.r14);
>>> +            PRINT_NE(regs.r13);
>>> +            PRINT_NE(regs.r12);
>>> +            PRINT_NE(regs.rbp);
>>> +            PRINT_NE(regs.rbx);
>>> +            PRINT_NE(regs.r10);
>>> +            PRINT_NE(regs.r11);
>>> +            PRINT_NE(regs.r9);
>>> +            PRINT_NE(regs.r8);
>>> +            PRINT_NE(regs.rax);
>>> +            PRINT_NE(regs.rcx);
>>> +            PRINT_NE(regs.rdx);
>>> +            PRINT_NE(regs.rsi);
>>> +            PRINT_NE(regs.rdi);
>> 
>> Aren't these register fields all of the same type? If so, why do you
>> need to casts to unsigned long in the macro?
> 
> As it happens, they're all the same size; when I wrote the macro it was
> designed such that the same macro could be used for all the elements
> regardless of what size they were.  Since there's no time pressure,
> would you rather I add the segment registers (and leave the cast), or
> only add rflags (and remove the cast)?

Printing the selector registers separately is more important than
macro cosmetics, so if you end up using the macro for them, then
I'm of course fine with the cast left in place.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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