[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 05/10] accel/tcg: Merge cpu_transaction_failed into io_failed
From: |
Richard Henderson |
Subject: |
[PATCH 05/10] accel/tcg: Merge cpu_transaction_failed into io_failed |
Date: |
Mon, 28 Aug 2023 11:55:45 -0700 |
Push computation down into the if statements to the point
the data is used.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
accel/tcg/cputlb.c | 33 +++++++++++++--------------------
1 file changed, 13 insertions(+), 20 deletions(-)
diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index b1dc213675..d2e4c4459d 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -1347,23 +1347,6 @@ static inline void cpu_unaligned_access(CPUState *cpu,
vaddr addr,
mmu_idx, retaddr);
}
-static inline void cpu_transaction_failed(CPUState *cpu, hwaddr physaddr,
- vaddr addr, unsigned size,
- MMUAccessType access_type,
- int mmu_idx, MemTxAttrs attrs,
- MemTxResult response,
- uintptr_t retaddr)
-{
- CPUClass *cc = CPU_GET_CLASS(cpu);
-
- if (!cpu->ignore_memory_transaction_failures &&
- cc->tcg_ops->do_transaction_failed) {
- cc->tcg_ops->do_transaction_failed(cpu, physaddr, addr, size,
- access_type, mmu_idx, attrs,
- response, retaddr);
- }
-}
-
static MemoryRegionSection *
io_prepare(hwaddr *out_offset, CPUArchState *env, hwaddr xlat,
MemTxAttrs attrs, vaddr addr, uintptr_t retaddr)
@@ -1387,9 +1370,19 @@ static void io_failed(CPUArchState *env, CPUTLBEntryFull
*full, vaddr addr,
unsigned size, MMUAccessType access_type, int mmu_idx,
MemTxResult response, uintptr_t retaddr)
{
- hwaddr physaddr = full->phys_addr | (addr & ~TARGET_PAGE_MASK);
- cpu_transaction_failed(env_cpu(env), physaddr, addr, size, access_type,
- mmu_idx, full->attrs, response, retaddr);
+ CPUState *cpu = env_cpu(env);
+
+ if (!cpu->ignore_memory_transaction_failures) {
+ CPUClass *cc = CPU_GET_CLASS(cpu);
+
+ if (cc->tcg_ops->do_transaction_failed) {
+ hwaddr physaddr = full->phys_addr | (addr & ~TARGET_PAGE_MASK);
+
+ cc->tcg_ops->do_transaction_failed(cpu, physaddr, addr, size,
+ access_type, mmu_idx,
+ full->attrs, response, retaddr);
+ }
+ }
}
static uint64_t io_readx(CPUArchState *env, CPUTLBEntryFull *full,
--
2.34.1
- [PATCH 00/10] plugin and tcg cleanups to cputlb.c., Richard Henderson, 2023/08/28
- [PATCH 03/10] accel/tcg: Use CPUTLBEntryFull.phys_addr in io_failed, Richard Henderson, 2023/08/28
- [PATCH 04/10] plugin: Simplify struct qemu_plugin_hwaddr, Richard Henderson, 2023/08/28
- [PATCH 01/10] accel/tcg: Simplify tlb_plugin_lookup, Richard Henderson, 2023/08/28
- [PATCH 02/10] accel/tcg: Split out io_prepare and io_failed, Richard Henderson, 2023/08/28
- [PATCH 05/10] accel/tcg: Merge cpu_transaction_failed into io_failed,
Richard Henderson <=
- [PATCH 06/10] accel/tcg: Replace direct use of io_readx/io_writex in do_{ld, st}_1, Richard Henderson, 2023/08/28
- [PATCH 09/10] accel/tcg: Introduce do_ld16_mmio_beN, Richard Henderson, 2023/08/28
- [PATCH 07/10] accel/tcg: Merge io_readx into do_ld_mmio_beN, Richard Henderson, 2023/08/28
- [PATCH 08/10] accel/tcg: Merge io_writex into do_st_mmio_leN, Richard Henderson, 2023/08/28
- [PATCH 10/10] accel/tcg: Introduce do_st16_mmio_leN, Richard Henderson, 2023/08/28