diff options
| author | Anthony Liguori | 2013-07-22 17:14:18 +0200 |
|---|---|---|
| committer | Anthony Liguori | 2013-07-22 17:14:18 +0200 |
| commit | c9fea5d701f8fd33f0843728ec264d95cee3ed37 (patch) | |
| tree | 16d34b137699c16d62ff516d5b32d8c1ec73427b /exec.c | |
| parent | Merge remote-tracking branch 'mjt/trivial-patches' into staging (diff) | |
| parent | exec: fix incorrect assumptions in memory_access_size (diff) | |
| download | qemu-c9fea5d701f8fd33f0843728ec264d95cee3ed37.tar.gz qemu-c9fea5d701f8fd33f0843728ec264d95cee3ed37.tar.xz qemu-c9fea5d701f8fd33f0843728ec264d95cee3ed37.zip | |
Merge remote-tracking branch 'bonzini/iommu-for-anthony' into staging
# By Paolo Bonzini (2) and others
# Via Paolo Bonzini
* bonzini/iommu-for-anthony:
exec: fix incorrect assumptions in memory_access_size
memory: Return -1 again on reads from unsigned regions
memory: actually set the owner
exec.c: Pass correct pointer type to qemu_ram_ptr_length
Message-id: 1374264478-23913-1-git-send-email-pbonzini@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'exec.c')
| -rw-r--r-- | exec.c | 11 |
1 files changed, 2 insertions, 9 deletions
@@ -1379,7 +1379,7 @@ static void *qemu_safe_ram_ptr(ram_addr_t addr) /* Return a host pointer to guest's ram. Similar to qemu_get_ram_ptr * but takes a size argument */ -static void *qemu_ram_ptr_length(ram_addr_t addr, ram_addr_t *size) +static void *qemu_ram_ptr_length(ram_addr_t addr, hwaddr *size) { if (*size == 0) { return NULL; @@ -1898,14 +1898,10 @@ static inline bool memory_access_is_direct(MemoryRegion *mr, bool is_write) static int memory_access_size(MemoryRegion *mr, unsigned l, hwaddr addr) { - unsigned access_size_min = mr->ops->impl.min_access_size; - unsigned access_size_max = mr->ops->impl.max_access_size; + unsigned access_size_max = mr->ops->valid.max_access_size; /* Regions are assumed to support 1-4 byte accesses unless otherwise specified. */ - if (access_size_min == 0) { - access_size_min = 1; - } if (access_size_max == 0) { access_size_max = 4; } @@ -1922,9 +1918,6 @@ static int memory_access_size(MemoryRegion *mr, unsigned l, hwaddr addr) if (l > access_size_max) { l = access_size_max; } - /* ??? The users of this function are wrong, not supporting minimums larger - than the remaining length. C.f. memory.c:access_with_adjusted_size. */ - assert(l >= access_size_min); return l; } |
