qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: x86 TCG helpers clobbered registers


From: Richard Henderson
Subject: Re: x86 TCG helpers clobbered registers
Date: Tue, 8 Dec 2020 15:18:54 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

On 12/7/20 4:10 AM, Stephane Duverger wrote:
> This leads me to that simple reflection:
> 
> If we want to filter on every memory accesses, *out of the fast-path*,
> the most natural place to do so would be in store_helper() and
> load_helper() from accel/tcg/cputlb.c. By doing so, every target would
> benefit from filtering, and even specific helpers using cpu_ldst
> functions would be intercepted. No ?
> 
> For the remaining fast-path case, it could be interesting to generate
> it this time at IR level (tlb_load, jne to slow_path, direct
> load/store) ? Again every target would benefit from filtering without
> the need for a specific fast-path implementation in
> tcg/<arch>/tcg-target.c.inc
> 
> Wouldn't it be simplier than actual mem plugin implementation, which
> generate fitler callback *after* load/store and has specific extra
> work for tracking memory accesses performed from helpers (afaiu) ?
> 

As for modifying store_helper(), the reason not to do it there is that it
misses the fast-path cases.

As for modifying the fast path cases, the code is quite delicate, and you run
into problems with live registers.  Which could be worked around in each
backend, but... why?

Which naturally suggests separate instrumentation separate from the above,
which is exactly what we do.  So, no, I don't think it would be simpler any
other way.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]