[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 058/115] disas: Let disas::read_memory() handler return EIO on err
From: |
Paolo Bonzini |
Subject: |
[PULL 058/115] disas: Let disas::read_memory() handler return EIO on error |
Date: |
Thu, 11 Jun 2020 15:43:52 -0400 |
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Both cpu_memory_rw_debug() and address_space_read() return
an error on failed transaction. Check the returned value,
and return EIO in case of error.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
disas.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/disas.c b/disas.c
index 45285d3f63..c1397d3933 100644
--- a/disas.c
+++ b/disas.c
@@ -39,9 +39,11 @@ target_read_memory (bfd_vma memaddr,
struct disassemble_info *info)
{
CPUDebug *s = container_of(info, CPUDebug, info);
+ int r;
- cpu_memory_rw_debug(s->cpu, memaddr, myaddr, length, 0);
- return 0;
+ r = cpu_memory_rw_debug(s->cpu, memaddr, myaddr, length, 0);
+
+ return r ? EIO : 0;
}
/* Print an error message. We can assume that this is in response to
@@ -718,10 +720,11 @@ physical_read_memory(bfd_vma memaddr, bfd_byte *myaddr,
int length,
struct disassemble_info *info)
{
CPUDebug *s = container_of(info, CPUDebug, info);
+ MemTxResult res;
- address_space_read(s->cpu->as, memaddr, MEMTXATTRS_UNSPECIFIED,
- myaddr, length);
- return 0;
+ res = address_space_read(s->cpu->as, memaddr, MEMTXATTRS_UNSPECIFIED,
+ myaddr, length);
+ return res == MEMTX_OK ? 0 : EIO;
}
/* Disassembler for the monitor. */
--
2.26.2
- [PULL 091/115] i386: hvf: Use IP from CPUX86State, (continued)
- [PULL 091/115] i386: hvf: Use IP from CPUX86State, Paolo Bonzini, 2020/06/11
- [PULL 094/115] i386: hvf: Drop copy of RFLAGS defines, Paolo Bonzini, 2020/06/11
- [PULL 097/115] i386: hvf: Move mmio_buf into CPUX86State, Paolo Bonzini, 2020/06/11
- [PULL 096/115] i386: hvf: Move lazy_flags into CPUX86State, Paolo Bonzini, 2020/06/11
- [PULL 098/115] i386: hvf: Drop HVFX86EmulatorState, Paolo Bonzini, 2020/06/11
- [PULL 093/115] i386: hvf: Drop rflags from HVFX86EmulatorState, Paolo Bonzini, 2020/06/11
- [PULL 087/115] i386: hvf: Move HVFState definition into hvf, Paolo Bonzini, 2020/06/11
- [PULL 101/115] target/i386: sev: Move local structure definitions into .c file, Paolo Bonzini, 2020/06/11
- [PULL 100/115] target/i386: sev: Remove unused QSevGuestInfoClass, Paolo Bonzini, 2020/06/11
- [PULL 102/115] target/i386: sev: Rename QSevGuestInfo, Paolo Bonzini, 2020/06/11
- [PULL 058/115] disas: Let disas::read_memory() handler return EIO on error,
Paolo Bonzini <=
- [PULL 104/115] target/i386: sev: Partial cleanup to sev_state global, Paolo Bonzini, 2020/06/11
- [PULL 105/115] target/i386: sev: Remove redundant cbitpos and reduced_phys_bits fields, Paolo Bonzini, 2020/06/11
- [PULL 073/115] replay: implement fair mutex, Paolo Bonzini, 2020/06/11
- [PULL 103/115] target/i386: sev: Embed SEVState in SevGuestState, Paolo Bonzini, 2020/06/11
- [PULL 107/115] target/i386: sev: Remove redundant handle field, Paolo Bonzini, 2020/06/11
- [PULL 108/115] target/i386: sev: Unify SEVState and SevGuestState, Paolo Bonzini, 2020/06/11
- [PULL 109/115] checkpatch: reversed logic with acpi test checks, Paolo Bonzini, 2020/06/11
- [PULL 099/115] xen: fix build without pci passthrough, Paolo Bonzini, 2020/06/11
- [PULL 110/115] exec/memory: Remove unused MemoryRegionMmio type, Paolo Bonzini, 2020/06/11
- [PULL 114/115] stubs: move Xen stubs to accel/, Paolo Bonzini, 2020/06/11