On 11/19/2013 05:47 AM, Clemens Kolbitsch wrote: > Getting around this is not trivial, so if it's a new issue, does anyone have > an > idea how to approach it most meaningfully? I was thinking about detecting this > very specific case and marking the TB for re-translation only after the TB is > exited, but this is not very clean and also somewhat prone to errors. >
I don't believe there are any good solutions for this. See what's enabled by TARGET_HAS_PRECISE_SMC wrt flushing and re-generating TBs for other bits of self-modifying code. Which are strictly at odds with the desire here to continue executing the same REP. I have a feeling even your example isn't robust even on real HW, in that if any kind of interrupt occurs, the REP will terminate and (if overwritten) fail to restart. Even with CLI, system management interrupts can still occur. r~