Bug 493003 - amd64: Support cmps repnz prefix and non-repeating cases
Summary: amd64: Support cmps repnz prefix and non-repeating cases
Status: REPORTED
Alias: None
Product: valgrind
Classification: Developer tools
Component: vex (show other bugs)
Version: 3.23 GIT
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-12 06:19 UTC by Matt Borgerson
Modified: 2024-09-12 06:26 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Patch (1.21 KB, patch)
2024-09-12 06:19 UTC, Matt Borgerson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Borgerson 2024-09-12 06:19:36 UTC
Created attachment 173576 [details]
Patch

SUMMARY

Attached patch adds support for repnz prefix, which is another encoding for rep cmps, and the case where there is no rep prefix for a cmps instruction.

Closes 253436, 340469, 406132

STEPS TO REPRODUCE

Build and run https://github.com/qemu/qemu/blob/master/tests/tcg/i386/test-i386.c

OBSERVED RESULT

Crash when these instructions are encountered.

EXPECTED RESULT

cmps should work with the repnz prefix, and without a rep prefix.

SOFTWARE/OS VERSIONS
Valgrind: VALGRIND_3_23_0-108-g5d404b97d

ADDITIONAL INFORMATION

Discovered via QEMU differential tests. A version of these tests, with these particular cases commented out, are in Valgrind at /VEX/test/test-amd64.c, but the test in Valgrind repo does not compile.
Comment 1 Matt Borgerson 2024-09-12 06:26:24 UTC
Unfortunately I cannot edit the above comment, so please ignore my obvious error in description:

> which is another encoding for rep cmps,