[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH] target/s390x: don't double ld_code() when reading instru
Re: [RFC PATCH] target/s390x: don't double ld_code() when reading instructions
Tue, 12 Oct 2021 08:38:29 -0700
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0
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.