|
From: Julian S. <js...@ac...> - 2008-06-30 10:33:42
|
> What is your opinion about the patch below ? This patch allows
> Helgrind and DRD to recognize stwcx instructions as atomic: if stwcx
> performs a store, bus lock and bus unlock events are passed to
> Valgrind tools around the actual store.
> /* Success? Do the (32bit) store */
> + stmt( IRStmt_MBE(Imbe_BusLock) );
> storeBE( mkexpr(EA), mkSzNarrow32(ty, mkexpr(rS)) );
> + stmt( IRStmt_MBE(Imbe_BusUnlock) );
Well, I see that it would cause drd to not complain about stwcx
accesses, by causing it to ignore them:
case Ist_Store:
if (instrument && ! bus_locked)
{
instrument_store(bb, [...]
Problem is this really just uses Imbe_Bus{Lock,Unlock} as markers
around stores which you want to ignore. They are however intended
to state that an imaginary lock is held (on an x86 machine) for
the duration of a read-modify-write instruction, and I don't want to
re-use them for a different purpose. So I've added Imbe_SnoopedStoreBegin
and Imbe_SnoopedStoreEnd for that purpose instead. (r1857, r8316).
J
|