|
From: <sv...@va...> - 2005-08-05 00:25:16
|
Author: sewardj
Date: 2005-08-05 01:25:11 +0100 (Fri, 05 Aug 2005)
New Revision: 4326
Log:
ppc32-linux: clear reservation before running thread; see attached
comment for details.
Modified:
trunk/coregrind/m_scheduler/scheduler.c
Modified: trunk/coregrind/m_scheduler/scheduler.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_scheduler/scheduler.c 2005-08-05 00:10:11 UTC (rev =
4325)
+++ trunk/coregrind/m_scheduler/scheduler.c 2005-08-05 00:25:11 UTC (rev =
4326)
@@ -392,6 +392,26 @@
=20
VGP_PUSHCC(VgpRun);
=20
+# if defined(VGA_ppc32)
+ /* This is necessary due to the hacky way vex models reservations
+ on ppc. It's really quite incorrect for each thread to have its
+ own reservation flag/address, since it's really something that
+ all threads share (that's the whole point). But having shared
+ guest state is something we can't model with Vex. However, as
+ per PaulM's 2.4.0ppc, the reservation is modelled using a
+ reservation flag which is cleared at each context switch. So it
+ is indeed possible to get away with a per thread-reservation if
+ the thread's reservation is cleared before running it.
+
+ This should be abstractified and lifted out.
+ */
+ { Int i;
+ /* Clear any existing reservation. Be paranoid and clear them all.=
*/
+ for (i =3D 0; i < VG_N_THREADS; i++)
+ VG_(threads)[i].arch.vex.guest_RESVN =3D 0;
+ }
+# endif =20
+
/* there should be no undealt-with signals */
//vg_assert(VG_(threads)[tid].siginfo.si_signo =3D=3D 0);
=20
|
|
From: Nicholas N. <nj...@cs...> - 2005-08-05 14:02:27
|
On Fri, 5 Aug 2005, sv...@va... wrote: > Log: > ppc32-linux: clear reservation before running thread; see attached > comment for details. Good! It's easy to write a detailed log message but not put the details in comments in the code. Doing it the other way around, like this example, is much better IMHO. N |