On 29 November 2011 07:03, 陳韋任 <che...@iis.sinica.edu.tw> wrote: > > 1. cpu_unlink_tb (exec.c)
This function is broken even for pure TCG -- we know it has a race condition. As I said on IRC, I think that the right thing to do is to start by overhauling the current TCG code so that it is: (a) properly multithreaded (b) race condition free (c) well documented (d) clean code Then you have a firm foundation you can use as a basis for the LLVM integration (and in the course of doing this overhaul you'll have figured out enough of how the current code works to be clear about where hooks for invalidating your traces need to go). > The big problem is debugging. Yes. In this sort of hotspot based design it's very easy to end up with bugs that are intermittent or painful to reproduce and where you have very little clue about which version of the code for which address ended up misgenerated (since timing issues mean that what code is recompiled and when it is inserted will vary from run to run). Being able to conveniently get rid of some of this nondeterminism is vital for tracking down what actually goes wrong. -- PMM