[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC v2 3/6] memory: support unmapping of MemoryRegion
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [RFC v2 3/6] memory: support unmapping of MemoryRegion mapped into HVA parent |
Date: |
Mon, 08 Jun 2015 17:32:27 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 |
On 08/06/2015 17:19, Igor Mammedov wrote:
> +void qemu_ram_unmap_hva(ram_addr_t addr)
> +{
> + RAMBlock *block = find_ram_block(addr);
> +
> + assert(block);
> + mmap(block->host, block->used_length, PROT_NONE,
> + MAP_FIXED | MAP_NORESERVE | MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
> +}
> +
Hmm, this is not good. :( The area at block->host can be in use, for
example via memory_region_ref/memory_region_unref. This can happen a
bit after the memory_region_del_subregion. So you can SEGV if you
simply make a synchronous update. I'm not sure if there is a solution
(but thanks for splitting the patches in a way that made the problem
clear!).
Paolo
- Re: [Qemu-devel] [RFC v2 1/6] memory: get rid of memory_region_destructor_ram_from_ptr(), (continued)
[Qemu-devel] [RFC v2 4/6] hostmem: return recreated MemoryRegion if current can't be reused, Igor Mammedov, 2015/06/08
[Qemu-devel] [RFC v2 3/6] memory: support unmapping of MemoryRegion mapped into HVA parent, Igor Mammedov, 2015/06/08
- Re: [Qemu-devel] [RFC v2 3/6] memory: support unmapping of MemoryRegion mapped into HVA parent, Paolo Bonzini, 2015/06/08
- Re: [Qemu-devel] [RFC v2 3/6] memory: support unmapping of MemoryRegion mapped into HVA parent,
Paolo Bonzini <=
- Re: [Qemu-devel] [RFC v2 3/6] memory: support unmapping of MemoryRegion mapped into HVA parent, Igor Mammedov, 2015/06/08
- Re: [Qemu-devel] [RFC v2 3/6] memory: support unmapping of MemoryRegion mapped into HVA parent, Michael S. Tsirkin, 2015/06/08
- Re: [Qemu-devel] [RFC v2 3/6] memory: support unmapping of MemoryRegion mapped into HVA parent, Paolo Bonzini, 2015/06/08
- Re: [Qemu-devel] [RFC v2 3/6] memory: support unmapping of MemoryRegion mapped into HVA parent, Igor Mammedov, 2015/06/09
- Re: [Qemu-devel] [RFC v2 3/6] memory: support unmapping of MemoryRegion mapped into HVA parent, Paolo Bonzini, 2015/06/17
- Re: [Qemu-devel] [RFC v2 3/6] memory: support unmapping of MemoryRegion mapped into HVA parent, Igor Mammedov, 2015/06/17
- Re: [Qemu-devel] [RFC v2 3/6] memory: support unmapping of MemoryRegion mapped into HVA parent, Michael S. Tsirkin, 2015/06/17
- Re: [Qemu-devel] [RFC v2 3/6] memory: support unmapping of MemoryRegion mapped into HVA parent, Paolo Bonzini, 2015/06/17
- Re: [Qemu-devel] [RFC v2 3/6] memory: support unmapping of MemoryRegion mapped into HVA parent, Michael S. Tsirkin, 2015/06/17
[Qemu-devel] [RFC v2 2/6] memory: introduce MemoryRegion container with reserved HVA range, Igor Mammedov, 2015/06/08