Received: from eggs.gnu.org ([2001:4830:134:3::10]:41596) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDAIi-00055R-GB for qemu-devel@nongnu.org; Thu, 09 Jul 2015 07:47:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZDAIe-0005jj-Mv for qemu-devel@nongnu.org; Thu, 09 Jul 2015 07:47:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45609) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDAIe-0005jf-HQ for qemu-devel@nongnu.org; Thu, 09 Jul 2015 07:47:32 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 27B1035102C for ; Thu, 9 Jul 2015 11:47:32 +0000 (UTC) From: Igor Mammedov Date: Thu, 9 Jul 2015 13:47:20 +0200 Message-Id: <1436442444-132020-4-git-send-email-imammedo@redhat.com> In-Reply-To: <1436442444-132020-1-git-send-email-imammedo@redhat.com> References: <1436442444-132020-1-git-send-email-imammedo@redhat.com> Subject: [Qemu-devel] [PATCH v4 3/7] pc: reserve hotpluggable memory range with memory_region_init_hva_range() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, mst@redhat.com It makes sure that all hotplugged memory will be put in continuos HVA range allowing to use 1:1 GVA<->HVA mapping. 1:1 mapping will be used by vhost to reduce number of memory ranges for hotplugged memory to a single range that covers all hotpluggable memory address space. Signed-off-by: Igor Mammedov --- hw/i386/pc.c | 4 ++-- hw/mem/pc-dimm.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 7661ea9..75f73ec 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1373,8 +1373,8 @@ FWCfgState *pc_memory_init(MachineState *machine, exit(EXIT_FAILURE); } - memory_region_init(&pcms->hotplug_memory.mr, OBJECT(pcms), - "hotplug-memory", hotplug_mem_size); + memory_region_init_hva_range(&pcms->hotplug_memory.mr, OBJECT(pcms), + "hotplug-memory", hotplug_mem_size); memory_region_add_subregion(system_memory, pcms->hotplug_memory.base, &pcms->hotplug_memory.mr); } diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c index bb04862..cb98926 100644 --- a/hw/mem/pc-dimm.c +++ b/hw/mem/pc-dimm.c @@ -95,7 +95,7 @@ void pc_dimm_memory_plug(DeviceState *dev, MemoryHotplugState *hpms, goto out; } - memory_region_add_subregion(&hpms->mr, addr - hpms->base, mr); + memory_region_add_subregion_to_hva(&hpms->mr, addr - hpms->base, mr); vmstate_register_ram(mr, dev); numa_set_mem_node_id(addr, memory_region_size(mr), dimm->node); -- 1.8.3.1