mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
memory: propagate errors on I/O dispatch
Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
a649b9168c
commit
791af8c861
4 changed files with 36 additions and 30 deletions
|
@ -367,9 +367,9 @@ bool is_tcg_gen_code(uintptr_t pc_ptr);
|
|||
#if !defined(CONFIG_USER_ONLY)
|
||||
|
||||
struct MemoryRegion *iotlb_to_region(hwaddr index);
|
||||
uint64_t io_mem_read(struct MemoryRegion *mr, hwaddr addr,
|
||||
unsigned size);
|
||||
void io_mem_write(struct MemoryRegion *mr, hwaddr addr,
|
||||
bool io_mem_read(struct MemoryRegion *mr, hwaddr addr,
|
||||
uint64_t *pvalue, unsigned size);
|
||||
bool io_mem_write(struct MemoryRegion *mr, hwaddr addr,
|
||||
uint64_t value, unsigned size);
|
||||
|
||||
void tlb_fill(CPUArchState *env1, target_ulong addr, int is_write, int mmu_idx,
|
||||
|
|
|
@ -63,6 +63,7 @@ static inline DATA_TYPE glue(io_read, SUFFIX)(CPUArchState *env,
|
|||
target_ulong addr,
|
||||
uintptr_t retaddr)
|
||||
{
|
||||
uint64_t val;
|
||||
MemoryRegion *mr = iotlb_to_region(physaddr);
|
||||
|
||||
physaddr = (physaddr & TARGET_PAGE_MASK) + addr;
|
||||
|
@ -72,7 +73,8 @@ static inline DATA_TYPE glue(io_read, SUFFIX)(CPUArchState *env,
|
|||
}
|
||||
|
||||
env->mem_io_vaddr = addr;
|
||||
return io_mem_read(mr, physaddr, 1 << SHIFT);
|
||||
io_mem_read(mr, physaddr, &val, 1 << SHIFT);
|
||||
return val;
|
||||
}
|
||||
|
||||
/* handle all cases except unaligned access which span two pages */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue