summaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2013-05-24 14:39:13 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2013-05-29 16:26:44 +0200
commitbf8d5166395612b4e856fad57606eb0cff97ae2e (patch)
treec6ef0cd5a6594cea466a484e319f8b6e5151b361 /exec.c
parent0844e007624acb6dbf45bfb232286ce9502b424e (diff)
downloadqemu-bf8d5166395612b4e856fad57606eb0cff97ae2e.zip
exec: do not use error_mem_read
We will soon reach this case when doing (unaligned) accesses that span partly past the end of memory. We do not want to crash in that case. unassigned_mem_ops and rom_mem_ops are now the same. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/exec.c b/exec.c
index 7e22980e77..785eeebcbc 100644
--- a/exec.c
+++ b/exec.c
@@ -1412,18 +1412,6 @@ static const MemoryRegionOps unassigned_mem_ops = {
.endianness = DEVICE_NATIVE_ENDIAN,
};
-static uint64_t error_mem_read(void *opaque, hwaddr addr,
- unsigned size)
-{
- abort();
-}
-
-static const MemoryRegionOps rom_mem_ops = {
- .read = error_mem_read,
- .write = unassigned_mem_write,
- .endianness = DEVICE_NATIVE_ENDIAN,
-};
-
static void notdirty_mem_write(void *opaque, hwaddr ram_addr,
uint64_t val, unsigned size)
{
@@ -1455,7 +1443,7 @@ static void notdirty_mem_write(void *opaque, hwaddr ram_addr,
}
static const MemoryRegionOps notdirty_mem_ops = {
- .read = error_mem_read,
+ .read = unassigned_mem_read,
.write = notdirty_mem_write,
.endianness = DEVICE_NATIVE_ENDIAN,
};
@@ -1676,7 +1664,7 @@ MemoryRegion *iotlb_to_region(hwaddr index)
static void io_mem_init(void)
{
- memory_region_init_io(&io_mem_rom, &rom_mem_ops, NULL, "rom", UINT64_MAX);
+ memory_region_init_io(&io_mem_rom, &unassigned_mem_ops, NULL, "rom", UINT64_MAX);
memory_region_init_io(&io_mem_unassigned, &unassigned_mem_ops, NULL,
"unassigned", UINT64_MAX);
memory_region_init_io(&io_mem_notdirty, &notdirty_mem_ops, NULL,