diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-12-05 08:43:38 -0600 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-12-05 08:43:38 -0600 |
commit | 01e7a53aed945adafc3ee54e2159227839daf0b4 (patch) | |
tree | 992b5c4a38316289ed5b2fa6ddf486cb3d59bead /memory.c | |
parent | 4eb2d2d900eb6f63cad2b5cb6ca4273bfb9b230c (diff) | |
parent | f44336c594c7e7887ee43ece3b53ba68b827fd1d (diff) | |
download | qemu-01e7a53aed945adafc3ee54e2159227839daf0b4.zip qemu-01e7a53aed945adafc3ee54e2159227839daf0b4.tar.gz qemu-01e7a53aed945adafc3ee54e2159227839daf0b4.tar.bz2 |
Merge remote-tracking branch 'qemu-kvm/memory/batch' into staging
Diffstat (limited to 'memory.c')
-rw-r--r-- | memory.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -831,8 +831,14 @@ void memory_region_init(MemoryRegion *mr, static bool memory_region_access_valid(MemoryRegion *mr, target_phys_addr_t addr, - unsigned size) + unsigned size, + bool is_write) { + if (mr->ops->valid.accepts + && !mr->ops->valid.accepts(mr->opaque, addr, size, is_write)) { + return false; + } + if (!mr->ops->valid.unaligned && (addr & (size - 1))) { return false; } @@ -856,7 +862,7 @@ static uint32_t memory_region_read_thunk_n(void *_mr, MemoryRegion *mr = _mr; uint64_t data = 0; - if (!memory_region_access_valid(mr, addr, size)) { + if (!memory_region_access_valid(mr, addr, size, false)) { return -1U; /* FIXME: better signalling */ } @@ -880,7 +886,7 @@ static void memory_region_write_thunk_n(void *_mr, { MemoryRegion *mr = _mr; - if (!memory_region_access_valid(mr, addr, size)) { + if (!memory_region_access_valid(mr, addr, size, true)) { return; /* FIXME: better signalling */ } |