Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
accel/tcg: Use CPUTLBEntryFull.phys_addr in io_failed
Since the introduction of CPUTLBEntryFull, we can recover
the full cpu address space physical address without having
to examine the MemoryRegionSection.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Sep 16, 2023
1 parent fb3cb37 commit 0e11444
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions accel/tcg/cputlb.c
Expand Up @@ -1388,13 +1388,9 @@ io_prepare(hwaddr *out_offset, CPUArchState *env, hwaddr xlat,

static void io_failed(CPUArchState *env, CPUTLBEntryFull *full, vaddr addr,
unsigned size, MMUAccessType access_type, int mmu_idx,
MemTxResult response, uintptr_t retaddr,
MemoryRegionSection *section, hwaddr mr_offset)
MemTxResult response, uintptr_t retaddr)
{
hwaddr physaddr = (mr_offset +
section->offset_within_address_space -
section->offset_within_region);

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);
}
Expand All @@ -1420,7 +1416,7 @@ static uint64_t io_readx(CPUArchState *env, CPUTLBEntryFull *full,

if (r != MEMTX_OK) {
io_failed(env, full, addr, memop_size(op), access_type, mmu_idx,
r, retaddr, section, mr_offset);
r, retaddr);
}
return val;
}
Expand All @@ -1445,7 +1441,7 @@ static void io_writex(CPUArchState *env, CPUTLBEntryFull *full,

if (r != MEMTX_OK) {
io_failed(env, full, addr, memop_size(op), MMU_DATA_STORE, mmu_idx,
r, retaddr, section, mr_offset);
r, retaddr);
}
}

Expand Down

0 comments on commit 0e11444

Please sign in to comment.