diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2013-04-11 15:40:59 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2013-05-29 16:27:16 +0200 |
commit | 51644ab70ba125cb9545702d64890743d75b444b (patch) | |
tree | 420c1b45d6556c81b04d532ca4a05202c069e341 /include/sysemu | |
parent | c353e4cc08a2fce7c505dd0d04512ef3947adff8 (diff) | |
download | qemu-51644ab70ba125cb9545702d64890743d75b444b.zip qemu-51644ab70ba125cb9545702d64890743d75b444b.tar.gz qemu-51644ab70ba125cb9545702d64890743d75b444b.tar.bz2 |
memory: add address_space_access_valid
The old-style IOMMU lets you check whether an access is valid in a
given DMAContext. There is no equivalent for AddressSpace in the
memory API, implement it with a lookup of the dispatch tree.
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/sysemu')
-rw-r--r-- | include/sysemu/dma.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/sysemu/dma.h b/include/sysemu/dma.h index a52c93a..02e0dcd 100644 --- a/include/sysemu/dma.h +++ b/include/sysemu/dma.h @@ -113,7 +113,8 @@ static inline bool dma_memory_valid(DMAContext *dma, DMADirection dir) { if (!dma_has_iommu(dma)) { - return true; + return address_space_access_valid(dma->as, addr, len, + dir == DMA_DIRECTION_FROM_DEVICE); } else { return iommu_dma_memory_valid(dma, addr, len, dir); } |