Richard Henderson <richard.hender...@linaro.org> writes:

> On 5/18/20 7:53 PM, Richard Henderson wrote:
>> +    if (master_header.magic != RISU_MAGIC ||
>> +        master_header.risu_op != op ||
>> +        master_header.size != extra_size) {
>> +        res = RES_MISMATCH_HEAD;
>> +        goto fail_header;
>>      }
>
> Hmm.  This isn't ideal.
>
> Consider e.g. an insn being tested that should pass, so master steps past the
> insn to the UDF and sends OP_COMPARE.  But there's a bug in the emulator being
> tested so the apprentice gets SIGILL on the insn and so op ==
> OP_SIGILL.

In my experience this is one of the major failure modes as usually it's
a decode error or a -cpu version error that leads you to go astray.

That said most useful additional piece of information to dump would be
the insn word of the failing PC. We even know if one is on a RISU_OP and
one isn't so we can be a bit more expressive.

> So risu_op != op, but we only report the header difference.
>
> Perhaps that's good enough to understand the this particular problem, without
> the clutter of printing the rest of the reginfo frame -- at least if
> report_mismatch_header is improved to print risu_op names instead of numbers.
>
> Consider if master and apprentice are run with different --test-sve=<vq>
> values.  That will produce a mismatch in size.
>
> Which could be a serious problem, if master_header.size > sizeof(master_ri) --
> we can't even receive the data.  In that case, what I'm doing here printing 
> the
> size mismatch is all that's possible.
>
> But suppose master_header.size <= sizeof(master_ri), so we can receive the
> data.  So long as master_header.size == reginfo_size(&master_ri), then at 
> least
> the data is self-consistent, and we *can* print out the difference in
> report_mismatch_reg().  Which in this case is going to be the difference in 
> the
> two ri->sve_vl values.  That difference is likely to be easiest to understand
> for the end user.
>
> I should probably split out this receive logic from
> recv_and_compare_register_info so that it can be reused by dump.
>
>
> r~


-- 
Alex Bennée

Reply via email to