disInstr: unhandled instruction bytes: 0xF 0xAE 0xF8 0xF at 0x80CD05E: fast_memcpy_MMX2 (aclib_template.c:349) @@ aclib_template.c:346 #ifdef HAVE_MMX2 /* since movntq is weakly-ordered, a "sfence" * is needed to become ordered again. */ __asm__ __volatile__ ("sfence":::"memory"); #endif I found this when tried to debuging mplayer. My processor don't have SSE support. This 'sfence' instruction is known as MMX2 (MMXEXT, also know as integer SSE). It is used together with movntq. I guess that memory written my movntq should not be read before "sfence" instruction. But for now I only need not to get error on it.
Are you sure that you were using valgrind 2.1.2 here? Only as far as I can see valgrind 2.1.2 should handle that instruction just fine.
> ------- Additional Comments From thh cyberscience com 2004-07-25 16:52 ------- > Are you sure that you were using valgrind 2.1.2 here? Only as far as I can see valgrind 2.1.2 > should handle that instruction just fine. > bash-2.05b$ valgrind --version valgrind-2.1.2 __________________________________ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail
I've just tried this (in fact I added some tests for the memory fence instructions to valgrind's test suite) and it seems to work fine for me. I've just had a thought however - are you using an early Athlon (ie an original Athlon rather than an Athlon XP or MP)? If you're not sure that take a look at /proc/cpuinfo and see what the flags line says - if you have mmxext but not sse in the flags then that might be the problem.
*** Bug 85948 has been marked as a duplicate of this bug. ***
CVS commit by thughes: Move the decoding of SFENCE out of the SSE only part of disInstr as it exists on Athlon's that have MMXEXT support and those don't have SSE state so won't decode it where it was. CCMAIL: 85947-done@bugs.kde.org M +19 -3 vg_to_ucode.c 1.144 --- valgrind/coregrind/vg_to_ucode.c #1.143:1.144 @@ -3985,8 +3985,8 @@ static Addr disInstr ( UCodeBlock* cb, A } - /* LFENCE/MFENCE/SFENCE -- flush pending operations to memory */ + /* LFENCE/MFENCE -- flush pending operations to memory */ if (insn[0] == 0x0F && insn[1] == 0xAE && (epartIsReg(insn[2])) - && (gregOfRM(insn[2]) >= 5 && gregOfRM(insn[2]) <= 7)) + && (gregOfRM(insn[2]) >= 5 && gregOfRM(insn[2]) <= 6)) { vg_assert(sz == 4); @@ -3995,5 +3995,5 @@ static Addr disInstr ( UCodeBlock* cb, A Lit16, (((UShort)0x0F) << 8) | (UShort)0xAE, Lit16, (UShort)insn[2] ); - DIP("sfence\n"); + DIP("%sfence\n", gregOfRM(insn[2]) == 5 ? "l" : "m"); goto decode_success; } @@ -6853,4 +6853,20 @@ static Addr disInstr ( UCodeBlock* cb, A break; + case 0xAE: /* SFENCE */ + vg_assert(sz == 4); + modrm = getUChar(eip); + if (!epartIsReg(modrm)) { + goto decode_failure; + } + if (gregOfRM(modrm) != 7) { + goto decode_failure; + } + eip += lengthAMode(eip); + uInstr2(cb, SSE3, 0, /* ignore sz for internal ops */ + Lit16, (((UShort)0x0F) << 8) | (UShort)0xAE, + Lit16, (UShort)modrm ); + DIP("sfence\n"); + break; + case 0x71: case 0x72: case 0x73: { /* (sz==4): PSLL/PSRA/PSRL mmxreg by imm8 */
--- Tom Hughes <thh@cyberscience.com> wrote: > ------- You are receiving this mail because: ------- > You reported the bug, or are watching the reporter. > > http://bugs.kde.org/show_bug.cgi?id=85947 > > > > > ------- Additional Comments From thh cyberscience com 2004-07-25 17:22 ------- > I've just tried this (in fact I added some tests for the memory fence instructions to valgrind's > test suite) and it seems to work fine for me. > > I've just had a thought however - are you using an early Athlon (ie an original Athlon rather > than an Athlon XP or MP)? If you're not sure that take a look at /proc/cpuinfo and see what the > flags line says - if you have mmxext but not sse in the flags then that might be the problem. Yes I do. It is 1GHz Athlon Thunderburd. And the mplayer is optimized for it. processor : 0 vendor_id : AuthenticAMD cpu family : 6 model : 4 model name : AMD Athlon(tm) processor stepping : 2 cpu MHz : 1000.050 cache size : 256 KB fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no fpu : yes fpu_exception : yes cpuid level : 1 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 mmx fxsr syscall mmxext 3dnowext 3dnow bogomips : 1992.29 __________________________________ Do you Yahoo!? Yahoo! Mail is new and improved - Check it out! http://promotions.yahoo.com/new_mail
Works for me. Thank you very much. :)) --- Tom Hughes <thh@cyberscience.com> wrote: > ------- You are receiving this mail because: ------- > You reported the bug, or are watching the reporter. > > http://bugs.kde.org/show_bug.cgi?id=85947 > thh cyberscience com changed: > > What |Removed |Added > ---------------------------------------------------------------------------- > Status|UNCONFIRMED |RESOLVED > Resolution| |FIXED > > > > ------- Additional Comments From thh cyberscience com 2004-07-25 17:43 ------- > CVS commit by thughes: > > Move the decoding of SFENCE out of the SSE only part of disInstr as it > exists on Athlon's that have MMXEXT support and those don't have SSE state > so won't decode it where it was. > > CCMAIL: 85947-done bugs kde org > > > M +19 -3 vg_to_ucode.c 1.144 > > > --- valgrind/coregrind/vg_to_ucode.c #1.143:1.144 > @ -3985,8 +3985,8 @ static Addr disInstr ( UCodeBlock* cb, A > } > > - /* LFENCE/MFENCE/SFENCE -- flush pending operations to memory */ > + /* LFENCE/MFENCE -- flush pending operations to memory */ > if (insn[0] == 0x0F && insn[1] == 0xAE > && (epartIsReg(insn[2])) > - && (gregOfRM(insn[2]) >= 5 && gregOfRM(insn[2]) <= 7)) > + && (gregOfRM(insn[2]) >= 5 && gregOfRM(insn[2]) <= 6)) > { > vg_assert(sz == 4); > @ -3995,5 +3995,5 @ static Addr disInstr ( UCodeBlock* cb, A > Lit16, (((UShort)0x0F) << 8) | (UShort)0xAE, > Lit16, (UShort)insn[2] ); > - DIP("sfence\n"); > + DIP("%sfence\n", gregOfRM(insn[2]) == 5 ? "l" : "m"); > goto decode_success; > } > @ -6853,4 +6853,20 @ static Addr disInstr ( UCodeBlock* cb, A > break; > > + case 0xAE: /* SFENCE */ > + vg_assert(sz == 4); > + modrm = getUChar(eip); > + if (!epartIsReg(modrm)) { > + goto decode_failure; > + } > + if (gregOfRM(modrm) != 7) { > + goto decode_failure; > + } > + eip += lengthAMode(eip); > + uInstr2(cb, SSE3, 0, /* ignore sz for internal ops */ > + Lit16, (((UShort)0x0F) << 8) | (UShort)0xAE, > + Lit16, (UShort)modrm ); > + DIP("sfence\n"); > + break; > + > case 0x71: case 0x72: case 0x73: { > /* (sz==4): PSLL/PSRA/PSRL mmxreg by imm8 */ > __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail