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

Re: [Xen-devel] [PATCH v3 3/3] x86/emulate: added tests for {, v}movd mm, r32/m32 and {, v}movq xmm, r64/m64



On Monday 01 August 2016 10:54:10 Andrew Cooper wrote:
> On 01/08/16 03:52, Mihai Donțu wrote:
> > Signed-off-by: Mihai Donțu <mdontu@xxxxxxxxxxxxxxx>
> > ---
> > Changed since v2:
> >  * added tests for {,v}movq xmm,r64
> > ---
> >  tools/tests/x86_emulator/test_x86_emulator.c | 120 
> > +++++++++++++++++++++++++++
> >  1 file changed, 120 insertions(+)
> >
> > diff --git a/tools/tests/x86_emulator/test_x86_emulator.c 
> > b/tools/tests/x86_emulator/test_x86_emulator.c
> > index 8994149..fb59b0f 100644
> > --- a/tools/tests/x86_emulator/test_x86_emulator.c
> > +++ b/tools/tests/x86_emulator/test_x86_emulator.c
> > @@ -650,6 +650,88 @@ int main(int argc, char **argv)
> >  #define check_eip(which) (regs.eip == (unsigned long)instr + \
> >                                        (unsigned long)which##_len)
> >  
> > +    printf("%-40s", "Testing movd %%mm3,32(%%eax)...");
> > +    if ( stack_exec && cpu_has_mmx )
> > +    {
> > +        decl_insn(movd_to_mem32);
> > +
> > +        asm volatile ( "pcmpeqb %%mm3, %%mm3\n"
> > +                       put_insn(movd_to_mem32, "movd %%mm3, 32(%%eax)")
> > +                       :: );
> > +
> > +        *(res + 8) = 0xbdbdbdbd;
> > +        set_insn(movd_to_mem32);
> > +        regs.eax = (unsigned long)res;
> > +        rc = x86_emulate(&ctxt, &emulops);
> > +        if ( (rc != X86EMUL_OKAY) || *(res + 8) != 0xffffffff ||
> > +             !check_eip(movd_to_mem32) )
> > +            goto fail;
> > +        printf("okay\n");
> > +    }
> > +    else
> > +        printf("skipped\n");
> > +
> > +    printf("%-40s", "Testing movd %%mm3,%%eax...");  
> 
> Could we possibly change this to %ebx instead of %eax?

Sure thing!

> That case is far more likely to go bang in a debug build if the emulator
> is wrong.
> 
> Otherwise, Revewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

-- 
Mihai DONȚU

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