|
From: Josef W. <Jos...@gm...> - 2013-06-20 12:15:58
|
Am 20.06.2013 11:27, schrieb Julian Seward: > (1) translate "XBEGIN fail-addr" as "goto fail-addr"; that is: push > simulated execution directly onto the failure path. This is simple > but will have poor performance, if (as is likely) the failure path > uses normal locking and is not tuned for speed. > > (2) translate "XBEGIN fail-addr" by handing it through to the real CPU, > in the same kind of way we handle CPUID, RDTSC, etc. Of course we will > have to put our own failure-handler address so we don't lose control > of execution if the transaction is aborted, but that's not difficult. > > --- > > (1) is simple but likely to work. (2) is probably preferable but I don't > know if there will be hidden problems in it. I do not see a hidden problem at the moment. But the code added by VG + tool (just assume cache simulation) will raise the probability for transaction failure significantly. And doing a rollback + failure path is slower than doing the failure path from the beginning. So (1) may not be a bad option at all. What about (3) if XBEGIN/XEND is found in the same SB, remove them. As VG is serializing threads, there is no way for a conflict within a SB anyway. Hm. A problem would be exceptions raised between XBEGIN/XEND. A transaction would simply fail... Josef PS: Using TM ourself should be a very nice solution to make memcheck fast when we remove serializing of threads at one point. The move forward here would be to let the tool decide whether VG core should do serialization or not. If TM is not available, memcheck would go with thread serialization as now. PS2: making the handling of TM transparent to tools means that e.g. cache simulation cannot tell anything about how TM would influence the cache. Current TM implementations use ways of cache sets to store transaction changes, thus influencing miss behavior. This is just a note; i do not suggest to simulate TM in VG ;-) > This also assumes that the s390 and POWER instructions can be mapped to > this same structure: TRANSACTION-START(fail-addr) and TRANSACTION-END. > That's probably the first thing that we should investigate. > > J > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > Valgrind-developers mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-developers > |