mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-10-01 16:53:46 +00:00
accel/tcg: Avoid unnecessary call overhead from qemu_plugin_vcpu_mem_cb
If there are not any QEMU plugin memory callback functions, checking before calling the qemu_plugin_vcpu_mem_cb function can reduce the function call overhead. Signed-off-by: Max Chou <max.chou@sifive.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Frank Chang <frank.chang@sifive.com> Message-Id: <20240613175122.1299212-2-max.chou@sifive.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20240620152220.2192768-13-alex.bennee@linaro.org>
This commit is contained in:
parent
ca7d7f4276
commit
fce3d48038
|
@ -125,8 +125,10 @@ void helper_st_i128(CPUArchState *env, uint64_t addr, Int128 val, MemOpIdx oi)
|
||||||
|
|
||||||
static void plugin_load_cb(CPUArchState *env, abi_ptr addr, MemOpIdx oi)
|
static void plugin_load_cb(CPUArchState *env, abi_ptr addr, MemOpIdx oi)
|
||||||
{
|
{
|
||||||
|
if (cpu_plugin_mem_cbs_enabled(env_cpu(env))) {
|
||||||
qemu_plugin_vcpu_mem_cb(env_cpu(env), addr, oi, QEMU_PLUGIN_MEM_R);
|
qemu_plugin_vcpu_mem_cb(env_cpu(env), addr, oi, QEMU_PLUGIN_MEM_R);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t cpu_ldb_mmu(CPUArchState *env, abi_ptr addr, MemOpIdx oi, uintptr_t ra)
|
uint8_t cpu_ldb_mmu(CPUArchState *env, abi_ptr addr, MemOpIdx oi, uintptr_t ra)
|
||||||
{
|
{
|
||||||
|
@ -188,8 +190,10 @@ Int128 cpu_ld16_mmu(CPUArchState *env, abi_ptr addr,
|
||||||
|
|
||||||
static void plugin_store_cb(CPUArchState *env, abi_ptr addr, MemOpIdx oi)
|
static void plugin_store_cb(CPUArchState *env, abi_ptr addr, MemOpIdx oi)
|
||||||
{
|
{
|
||||||
|
if (cpu_plugin_mem_cbs_enabled(env_cpu(env))) {
|
||||||
qemu_plugin_vcpu_mem_cb(env_cpu(env), addr, oi, QEMU_PLUGIN_MEM_W);
|
qemu_plugin_vcpu_mem_cb(env_cpu(env), addr, oi, QEMU_PLUGIN_MEM_W);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void cpu_stb_mmu(CPUArchState *env, abi_ptr addr, uint8_t val,
|
void cpu_stb_mmu(CPUArchState *env, abi_ptr addr, uint8_t val,
|
||||||
MemOpIdx oi, uintptr_t retaddr)
|
MemOpIdx oi, uintptr_t retaddr)
|
||||||
|
|
Loading…
Reference in a new issue