On 10/12/21 7:52 AM, Alex Bennée wrote:
I think the plugin stuff could be more clever, knowing where the read
occurs within the sequence. Otherwise, we should simplify the
interface so that it is not possible to make this mistake.
It's plugin_insn_append which is doing the tracking here so we could
extend the interface to include the current pc of the load and make the
appropriate adjustments. That said it's a bunch hoops to jump every
instruction when we could just as easily add an assert and fix up any
cases where we do. I guess it comes down to how prevalent double dipping
in the instruction stream is when constructing a translation?
Yes, which is why I suggested simplifying the interface to translate_ld*. It currently
takes the DisasContextBase; it could potentially read from pc_next, and increment it. It
would completely eliminate the problem you're encountering.
What happens if the protection of the code area changes half way through
a translation? Could a mapping change in flight?
No, we hold mmap_lock.
r~