[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 26/33] tcg/tci: Use {set,clear}_helper_retaddr
From: |
Richard Henderson |
Subject: |
[PULL 26/33] tcg/tci: Use {set,clear}_helper_retaddr |
Date: |
Sat, 19 Jun 2021 11:14:45 -0700 |
Wrap guest memory operations for tci like we do for cpu_ld*_data.
We cannot actually use the cpu_ldst.h interface without duplicating
the memory trace operations performed within, which will already
have been expanded into the tcg opcode stream.
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/tci.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/tcg/tci.c b/tcg/tci.c
index a5670f2109..71689d4a40 100644
--- a/tcg/tci.c
+++ b/tcg/tci.c
@@ -292,10 +292,9 @@ static uint64_t tci_qemu_ld(CPUArchState *env,
target_ulong taddr,
TCGMemOpIdx oi, const void *tb_ptr)
{
MemOp mop = get_memop(oi) & (MO_BSWAP | MO_SSIZE);
-
-#ifdef CONFIG_SOFTMMU
uintptr_t ra = (uintptr_t)tb_ptr;
+#ifdef CONFIG_SOFTMMU
switch (mop) {
case MO_UB:
return helper_ret_ldub_mmu(env, taddr, oi, ra);
@@ -328,6 +327,7 @@ static uint64_t tci_qemu_ld(CPUArchState *env, target_ulong
taddr,
void *haddr = g2h(env_cpu(env), taddr);
uint64_t ret;
+ set_helper_retaddr(ra);
switch (mop) {
case MO_UB:
ret = ldub_p(haddr);
@@ -368,6 +368,7 @@ static uint64_t tci_qemu_ld(CPUArchState *env, target_ulong
taddr,
default:
g_assert_not_reached();
}
+ clear_helper_retaddr();
return ret;
#endif
}
@@ -376,10 +377,9 @@ static void tci_qemu_st(CPUArchState *env, target_ulong
taddr, uint64_t val,
TCGMemOpIdx oi, const void *tb_ptr)
{
MemOp mop = get_memop(oi) & (MO_BSWAP | MO_SSIZE);
-
-#ifdef CONFIG_SOFTMMU
uintptr_t ra = (uintptr_t)tb_ptr;
+#ifdef CONFIG_SOFTMMU
switch (mop) {
case MO_UB:
helper_ret_stb_mmu(env, taddr, val, oi, ra);
@@ -408,6 +408,7 @@ static void tci_qemu_st(CPUArchState *env, target_ulong
taddr, uint64_t val,
#else
void *haddr = g2h(env_cpu(env), taddr);
+ set_helper_retaddr(ra);
switch (mop) {
case MO_UB:
stb_p(haddr, val);
@@ -433,6 +434,7 @@ static void tci_qemu_st(CPUArchState *env, target_ulong
taddr, uint64_t val,
default:
g_assert_not_reached();
}
+ clear_helper_retaddr();
#endif
}
--
2.25.1
- [PULL 05/33] accel/tcg: Add tcg call flags to plugins helpers, (continued)
- [PULL 05/33] accel/tcg: Add tcg call flags to plugins helpers, Richard Henderson, 2021/06/19
- [PULL 07/33] tcg: Add tcg_call_func, Richard Henderson, 2021/06/19
- [PULL 08/33] tcg: Build ffi data structures for helpers, Richard Henderson, 2021/06/19
- [PULL 09/33] tcg/tci: Improve tcg_target_call_clobber_regs, Richard Henderson, 2021/06/19
- [PULL 02/33] tcg: Add tcg_call_flags, Richard Henderson, 2021/06/19
- [PULL 10/33] tcg/tci: Move call-return regs to end of tcg_target_reg_alloc_order, Richard Henderson, 2021/06/19
- [PULL 11/33] tcg/tci: Use ffi for calls, Richard Henderson, 2021/06/19
- [PULL 18/33] tcg/tci: Implement andc, orc, eqv, nand, nor, Richard Henderson, 2021/06/19
- [PULL 12/33] tcg/tci: Reserve r13 for a temporary, Richard Henderson, 2021/06/19
- [PULL 30/33] tcg: Allocate sufficient storage in temp_allocate_frame, Richard Henderson, 2021/06/19
- [PULL 26/33] tcg/tci: Use {set,clear}_helper_retaddr,
Richard Henderson <=
- [PULL 25/33] tcg/tci: Remove the qemu_ld/st_type macros, Richard Henderson, 2021/06/19
- [PULL 31/33] tcg: Restart when exhausting the stack frame, Richard Henderson, 2021/06/19
- [PULL 14/33] tcg/tci: Remove tci_write_reg, Richard Henderson, 2021/06/19
- [PULL 17/33] tcg/tci: Implement movcond, Richard Henderson, 2021/06/19
- [PULL 19/33] tcg/tci: Implement extract, sextract, Richard Henderson, 2021/06/19
- [PULL 22/33] tcg/tci: Implement add2, sub2, Richard Henderson, 2021/06/19
- [PULL 13/33] tcg/tci: Emit setcond before brcond, Richard Henderson, 2021/06/19
- [PULL 20/33] tcg/tci: Implement clz, ctz, ctpop, Richard Henderson, 2021/06/19
- [PULL 15/33] tcg/tci: Change encoding to uint32_t units, Richard Henderson, 2021/06/19
- [PULL 16/33] tcg/tci: Implement goto_ptr, Richard Henderson, 2021/06/19