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

Re: [Xen-devel] [PATCH] tools/tests: Add EIP check to test_x86_emulator.c


  • To: Jürgen Groß <jgross@xxxxxxxx>, xen-devel@xxxxxxxxxxxxx
  • From: Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>
  • Date: Thu, 07 Aug 2014 11:27:03 +0300
  • Cc: andrew.cooper3@xxxxxxxxxx, ian.jackson@xxxxxxxxxxxxx, ian.campbell@xxxxxxxxxx, JBeulich@xxxxxxxx, stefano.stabellini@xxxxxxxxxxxxx
  • Comment: DomainKeys? See http://domainkeys.sourceforge.net/
  • Delivery-date: Thu, 07 Aug 2014 08:27:12 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=bitdefender.com; b=GdHtBhFEnBPO9Y4ezHrQKlpiXYgB0zRXewyt8jbeGuXLsjb/34B6i3U3NHZjuuuwoIihapnAZgz7pmthB5s+JiFtErDwRMd8oZ2V5oiupwDgm6srRCPpUZApLB8u4d0Kjy9OLASfZFi+2AhRcdx2huHYxbAntBs1SjuXlknfQRHORqnSbrKJsAkWnuROrtcYDy5zeu3n8q5BGwg4nkPPX4kaL3ttyGdXZsRALQ2S9FY+Y6fctQ2dOY4d6yTI0G7Aam49KIGbjQtW2Cvs5kuQFrfLdofc1gK+n6sza85ohXRYXue370O4MfdtVy3u2NLlBaEkWw5Rvl91mJfRNnxSvw==; h=Received:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-BitDefender-Scanner:X-BitDefender-Spam:X-BitDefender-SpamStamp:X-BitDefender-CF-Stamp;
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

On 08/07/2014 11:23 AM, Jürgen Groß wrote:
> On 08/07/2014 10:16 AM, Razvan Cojocaru wrote:
>> The test now also checks that EIP was modified after emulating
>> instructions after (and including) the "movq %mm3,(%ecx)..."
>> code block.
>>
>> Signed-off-by: Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>
>> ---
>>   tools/tests/x86_emulator/test_x86_emulator.c |   30
>> +++++++++++++++++---------
>>   1 file changed, 20 insertions(+), 10 deletions(-)
>>
>> diff --git a/tools/tests/x86_emulator/test_x86_emulator.c
>> b/tools/tests/x86_emulator/test_x86_emulator.c
>> index 0a00d5a..dd4e986 100644
>> --- a/tools/tests/x86_emulator/test_x86_emulator.c
>> +++ b/tools/tests/x86_emulator/test_x86_emulator.c
>> @@ -615,7 +615,8 @@ int main(int argc, char **argv)
>>           regs.eip    = (unsigned long)&instr[0];
>>           regs.ecx    = (unsigned long)res;
>>           rc = x86_emulate(&ctxt, &emulops);
>> -        if ( (rc != X86EMUL_OKAY) || memcmp(res, res + 8, 32) )
>> +        if ( (rc != X86EMUL_OKAY) || memcmp(res, res + 8, 32) ||
>> +             (regs.eip == (unsigned long)&instr[0]) )
> 
> Is really any modification okay? I think the test should check for
> the correct EIP, not just for one of 2^64 - 1 incorrect values.

While you are, of course, perfectly right that not any modification is
okay, this does at least catch the bigger issue of EIP not being updated
at all. I'll look into it.


Thanks,
Razvan Cojocaru


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


 


Rackspace

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