diff options
author | Eric Auger <eric.auger@redhat.com> | 2018-06-13 15:19:06 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2018-06-28 19:05:30 +0200 |
commit | a99761d3c85679da380c0f597468acd3dc1b53b3 (patch) | |
tree | 2487eac2ae7fb67662de7208435afd380ce8cc7e /trace | |
parent | 4a83bf2f339d4b63ecd5ef48b9816c3b7ee24553 (diff) | |
download | qemu-a99761d3c85679da380c0f597468acd3dc1b53b3.zip qemu-a99761d3c85679da380c0f597468acd3dc1b53b3.tar.gz qemu-a99761d3c85679da380c0f597468acd3dc1b53b3.tar.bz2 |
exec: Fix MAP_RAM for cached access
When an IOMMUMemoryRegion is in front of a virtio device,
address_space_cache_init does not set cache->ptr as the memory
region is not RAM. However when the device performs an access,
we end up in glue() which performs the translation and then uses
MAP_RAM. This latter uses the unset ptr and returns a wrong value
which leads to a SIGSEV in address_space_lduw_internal_cached_slow,
for instance.
In slow path cache->ptr is NULL and MAP_RAM must redirect to
qemu_map_ram_ptr((mr)->ram_block, ofs).
As MAP_RAM, IS_DIRECT and INVALIDATE are the same in _cached_slow
and non cached mode, let's remove those macros.
This fixes the use cases featuring vIOMMU (Intel and ARM SMMU)
which lead to a SIGSEV.
Fixes: 48564041a73a (exec: reintroduce MemoryRegion caching)
Signed-off-by: Eric Auger <eric.auger@redhat.com>
Message-Id: <1528895946-28677-1-git-send-email-eric.auger@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'trace')
0 files changed, 0 insertions, 0 deletions