Re: [Qemu-devel] [PATCH] exec: Fix MAP_RAM for cached access

2018-06-13 Thread Auger Eric
Hi Paolo, On 06/13/2018 11:56 AM, Paolo Bonzini wrote: > On 12/06/2018 21:05, Eric Auger wrote: >> 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

Re: [Qemu-devel] [PATCH] exec: Fix MAP_RAM for cached access

2018-06-13 Thread Paolo Bonzini
On 12/06/2018 21:05, Eric Auger wrote: > 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 > M

Re: [Qemu-devel] [PATCH] exec: Fix MAP_RAM for cached access

2018-06-12 Thread Peter Xu
On Wed, Jun 13, 2018 at 08:31:31AM +0200, Auger Eric wrote: > Hi Peter, > > On 06/13/2018 05:15 AM, Peter Xu wrote: > > On Tue, Jun 12, 2018 at 09:05:25PM +0200, Eric Auger wrote: > >> When an IOMMUMemoryRegion is in front of a virtio device, > >> address_space_cache_init does not set cache->ptr a

Re: [Qemu-devel] [PATCH] exec: Fix MAP_RAM for cached access

2018-06-12 Thread Auger Eric
Hi Peter, On 06/13/2018 05:15 AM, Peter Xu wrote: > On Tue, Jun 12, 2018 at 09:05:25PM +0200, Eric Auger wrote: >> 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 a

Re: [Qemu-devel] [PATCH] exec: Fix MAP_RAM for cached access

2018-06-12 Thread Peter Xu
On Tue, Jun 12, 2018 at 09:05:25PM +0200, Eric Auger wrote: > 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 translat

[Qemu-devel] [PATCH] exec: Fix MAP_RAM for cached access

2018-06-12 Thread Eric Auger
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 return