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

Re: [Xen-devel] [PATCH] x86/HVM: correct repeat count update in linear->phys translation



>>> On 07.09.17 at 13:35, <andrew.cooper3@xxxxxxxxxx> wrote:
> On 07/09/17 12:24, Jan Beulich wrote:
>>>>> On 07.09.17 at 13:15, <andrew.cooper3@xxxxxxxxxx> wrote:
>>> On 07/09/17 11:41, Jan Beulich wrote:
>>>> For the insn emulator's fallback logic in REP MOVS/STOS/INS/OUTS
>>>> handling to work correctly, *reps must not be set to zero when
>>>> returning X86EMUL_UNHANDLEABLE.
>>>>
>>>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>>> Why is this?  In the case that X86EMUL_UNHANDLEABLE is returned, the
>>> emulator appears to override nr_reps to 1.
>> Where did you see that? What we have is
>>
>>         if ( (nr_reps > 1 || rc == X86EMUL_UNHANDLEABLE) && ops->rep_ins )
>>             rc = ops->rep_ins(port, dst.mem.seg, dst.mem.off, dst.bytes,
>>                               &nr_reps, ctxt);
>>         if ( nr_reps >= 1 && rc == X86EMUL_UNHANDLEABLE )
>>         {
>>             fail_if(!ops->read_io || !ops->write);
>>             if ( (rc = ops->read_io(port, dst.bytes, &dst.val, ctxt)) != 0 )
>>                 goto done;
>>             nr_reps = 0;
>>         }
> 
> Ah - the INS/OUTS handing is different to the MOVS/STOS, where the
> MOVS/STOS does cope fine with reps being zero.

Oh, right.

> With a suitable adjustment to the commit message, Reviewed-by: Andrew
> Cooper <andrew.cooper3@xxxxxxxxxx>

I'd just dropped the MOVS/STOS from the text, but left it unchanged
otherwise.

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®.