From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1fNn-0006KK-2o for qemu-devel@nongnu.org; Tue, 23 Jul 2013 12:24:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V1fNk-00074k-II for qemu-devel@nongnu.org; Tue, 23 Jul 2013 12:24:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16625) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V1fNk-00074V-7x for qemu-devel@nongnu.org; Tue, 23 Jul 2013 12:24:12 -0400 From: Igor Mammedov Date: Tue, 23 Jul 2013 18:23:05 +0200 Message-Id: <1374596592-7027-10-git-send-email-imammedo@redhat.com> In-Reply-To: <1374596592-7027-1-git-send-email-imammedo@redhat.com> References: <1374596592-7027-1-git-send-email-imammedo@redhat.com> Subject: [Qemu-devel] [PATCH 09/16] pc: i440fx: add DimmBus to chipset and map it into hotplug memory region List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: vasilis.liaskovitis@profitbricks.com, hutao@cn.fujitsu.com, pbonzini@redhat.com it makes hot-plugged DimmDevices visible in guest address space. Signed-off-by: Igor Mammedov --- hw/pci-host/piix.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c index 26bb844..2ac7587 100644 --- a/hw/pci-host/piix.c +++ b/hw/pci-host/piix.c @@ -32,6 +32,7 @@ #include "hw/xen/xen.h" #include "hw/pci-host/pam.h" #include "sysemu/sysemu.h" +#include "hw/mem-hotplug/dimm.h" /* * I440FX chipset data sheet. @@ -96,6 +97,7 @@ struct PCII440FXState { PAMMemoryRegion pam_regions[13]; MemoryRegion smram_region; uint8_t smm_enabled; + DimmBus dimm_bus; }; @@ -221,6 +223,8 @@ static int i440fx_initfn(PCIDevice *dev) d->dev.config[I440FX_SMRAM] = 0x02; cpu_smm_register(&i440fx_set_smm, d); + + qbus_create_inplace(&d->dimm_bus, TYPE_DIMM_BUS, DEVICE(d), "membus"); return 0; } @@ -244,6 +248,7 @@ static PCIBus *i440fx_common_init(const char *device_name, PIIX3State *piix3; PCII440FXState *f; Range *pci_hole64 = &guest_info->pci_info.w64; + Range *hotplug_mem = &guest_info->hotplug_mem_win; unsigned i; dev = qdev_create(NULL, "i440FX-pcihost"); @@ -260,6 +265,13 @@ static PCIBus *i440fx_common_init(const char *device_name, f->system_memory = address_space_mem; f->pci_address_space = pci_address_space; f->ram_memory = ram_memory; + + f->dimm_bus.base = hotplug_mem->begin; + memory_region_init(&f->dimm_bus.as, "hotplug-memory", + hotplug_mem->end - hotplug_mem->begin); + memory_region_add_subregion(f->system_memory, f->dimm_bus.base, + &f->dimm_bus.as); + memory_region_init_alias(&f->pci_hole, "pci-hole", f->pci_address_space, pci_hole_start, pci_hole_size); memory_region_add_subregion(f->system_memory, pci_hole_start, &f->pci_hole); -- 1.7.1