On 2025/12/08 19:11, Peter Maydell wrote:
On Mon, 8 Dec 2025 at 09:37, Shusaku KURAMITSU
<[email protected]> wrote:
On 2025/12/05 23:44, Peter Maydell wrote:
No; if tcg_use_softmmu is false and a_mask is zero then
we will not take either the if() or the else if() block,
and ldst will still be NULL when we return it.
This is because:
* softmmu always requires a slowpath (because we might
look the guest address up in the TLB but not find it)
* linux-user mode needs a slowpath only if we need to
enforce alignment and atomicity checks for this
memory access (because linux-user always has "guest
address == host address + some constant", so most
simple loads and stores cannot fail or be complicated)
If we don't have to do either, then we don't need the slowpath.
Thanks for the reply! Perhaps the confusion is from what "requiring
slowpath" means. Does that mean requiring emitting slowpath (which
I suspect is what's happening here), or requiring jumping to
slowpath (i.e. never using fastpath), on softmmu?
Here I meant that we must emit code for the slow path,
because we cannot guarantee that we do not need it at
runtime. (If we are in this function at all then we
know it's at least possible that we might be able to
take the fast path and handle the load/store entirely
with the inline generated code.)
The only case where we can guarantee that we do not
need a slow path and can always complete the load/store
inline is for linux-user mode when there are no alignment
or atomicity constraints.
thanks
-- PMM
Thanks! That answers my question.
Shusaku KURAMITSU
Kyushu Institute of Technology, Japan