From: Julian Seward Date: Sat, 13 Jul 2002 12:32:16 +0000 (+0000) Subject: (Tim Rowley, verbatim) X-Git-Tag: svn/VALGRIND_1_0_3~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=344e4348dee0a22bc9e5e0579c37ff727acf8fa4;p=thirdparty%2Fvalgrind.git (Tim Rowley, verbatim) The Intel p4 manual suggests inserting a pause instruction in spin-wait loops as a hint to what the code is doing. In other respects it acts just like a nop. Pause (0xF3 0x90) currently causes valgrind to panic. The patch below keeps things running. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@493 --- diff --git a/coregrind/vg_to_ucode.c b/coregrind/vg_to_ucode.c index e56b02cab2..0b1e5c61dc 100644 --- a/coregrind/vg_to_ucode.c +++ b/coregrind/vg_to_ucode.c @@ -4111,6 +4111,11 @@ static Addr disInstr ( UCodeBlock* cb, Addr eip, Bool* isEnd ) codegen_REPE_STOS ( cb, sz, eip_orig, eip ); *isEnd = True; if (dis) VG_(printf)("repe stos%c\n", nameISize(sz)); + } + else + if (abyte == 0x90) { /* REPE NOP (PAUSE) */ + if (dis) VG_(printf)("repe nop (P4 pause)\n"); + /* do nothing; apparently a hint to the P4 re spin-wait loop */ } else { VG_(printf)("REPE then 0x%x\n", (UInt)abyte); VG_(panic)("Unhandled REPE case"); diff --git a/vg_to_ucode.c b/vg_to_ucode.c index e56b02cab2..0b1e5c61dc 100644 --- a/vg_to_ucode.c +++ b/vg_to_ucode.c @@ -4111,6 +4111,11 @@ static Addr disInstr ( UCodeBlock* cb, Addr eip, Bool* isEnd ) codegen_REPE_STOS ( cb, sz, eip_orig, eip ); *isEnd = True; if (dis) VG_(printf)("repe stos%c\n", nameISize(sz)); + } + else + if (abyte == 0x90) { /* REPE NOP (PAUSE) */ + if (dis) VG_(printf)("repe nop (P4 pause)\n"); + /* do nothing; apparently a hint to the P4 re spin-wait loop */ } else { VG_(printf)("REPE then 0x%x\n", (UInt)abyte); VG_(panic)("Unhandled REPE case");