qemu-devel
[Top][All Lists]
Advanced

[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:26:02 +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:
> +        assert(!subregion->hva_mapped);
>          if (rsvd_hva.mr) {
> +            subregion->hva_mapped = true;
>              qemu_ram_remap_hva(mr->ram_addr,
>                  memory_region_get_ram_ptr(rsvd_hva.mr) +
>                      rsvd_hva.offset_within_region);
> @@ -1788,6 +1790,15 @@ void memory_region_del_subregion(MemoryRegion *mr,
>  {
>      memory_region_transaction_begin();
>      assert(subregion->container == mr);
> +
> +    if (mr->ram) {

"if (subregion->hva_mapped)" I think would replace this "if" and the one
below.

Paolo

> +        MemoryRegionSection rsvd_hva = memory_region_find_hva_range(mr);
> +
> +        if (rsvd_hva.mr) {
> +            qemu_ram_unmap_hva(mr->ram_addr);
> +        }
> +    }
> +



reply via email to

[Prev in Thread] Current Thread [Next in Thread]