The following changes since commit df7131623daf4823e087eb1128f6c1c351519774: Merge remote-tracking branch ''bonzini/iommu-for-anthony'' into staging (2013-09-05 13:38:53 -0500) are available in the git repository at: git://xenbits.xen.org/people/sstabellini/qemu-dm.git xen-2013-09-09 Anthony PERARD (2): pc: Initializing ram_memory under Xen. pc_q35: Initialize Xen. hw/i386/pc_piix.c | 2 +- hw/i386/pc_q35.c | 5 +++++ include/hw/xen/xen.h | 4 +--- xen-all.c | 7 ++++--- xen-stub.c | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-)
Stefano Stabellini
2013-Sep-09 16:27 UTC
[PULL 1/2] pc: Initializing ram_memory under Xen.
From: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> CC: qemu-stable@nongnu.org --- hw/i386/pc_piix.c | 2 +- include/hw/xen/xen.h | 4 +--- xen-all.c | 7 ++++--- xen-stub.c | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 275e395..5bb4937 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -89,7 +89,7 @@ static void pc_init1(QEMUMachineInitArgs *args, FWCfgState *fw_cfg = NULL; PcGuestInfo *guest_info; - if (xen_enabled() && xen_hvm_init() != 0) { + if (xen_enabled() && xen_hvm_init(&ram_memory) != 0) { fprintf(stderr, "xen hardware virtual machine initialisation failed\n"); exit(1); } diff --git a/include/hw/xen/xen.h b/include/hw/xen/xen.h index 6d42dd1..e1f88bf 100644 --- a/include/hw/xen/xen.h +++ b/include/hw/xen/xen.h @@ -37,17 +37,15 @@ void xen_cmos_set_s3_resume(void *opaque, int irq, int level); qemu_irq *xen_interrupt_controller_init(void); int xen_init(void); -int xen_hvm_init(void); +int xen_hvm_init(MemoryRegion **ram_memory); void xenstore_store_pv_console_info(int i, struct CharDriverState *chr); #if defined(NEED_CPU_H) && !defined(CONFIG_USER_ONLY) -struct MemoryRegion; void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, struct MemoryRegion *mr); void xen_modified_memory(ram_addr_t start, ram_addr_t length); #endif -struct MemoryRegion; void xen_register_framebuffer(struct MemoryRegion *mr); #if defined(CONFIG_XEN) && CONFIG_XEN_CTRL_INTERFACE_VERSION < 400 diff --git a/xen-all.c b/xen-all.c index eb13111..839f14f 100644 --- a/xen-all.c +++ b/xen-all.c @@ -154,7 +154,7 @@ qemu_irq *xen_interrupt_controller_init(void) /* Memory Ops */ -static void xen_ram_init(ram_addr_t ram_size) +static void xen_ram_init(ram_addr_t ram_size, MemoryRegion **ram_memory_p) { MemoryRegion *sysmem = get_system_memory(); ram_addr_t below_4g_mem_size, above_4g_mem_size = 0; @@ -168,6 +168,7 @@ static void xen_ram_init(ram_addr_t ram_size) block_len += HVM_BELOW_4G_MMIO_LENGTH; } memory_region_init_ram(&ram_memory, NULL, "xen.ram", block_len); + *ram_memory_p = &ram_memory; vmstate_register_ram_global(&ram_memory); if (ram_size >= HVM_BELOW_4G_RAM_END) { @@ -1059,7 +1060,7 @@ static void xen_read_physmap(XenIOState *state) free(entries); } -int xen_hvm_init(void) +int xen_hvm_init(MemoryRegion **ram_memory) { int i, rc; unsigned long ioreq_pfn; @@ -1134,7 +1135,7 @@ int xen_hvm_init(void) /* Init RAM management */ xen_map_cache_init(xen_phys_offset_to_gaddr, state); - xen_ram_init(ram_size); + xen_ram_init(ram_size, ram_memory); qemu_add_vm_change_state_handler(xen_hvm_change_state_handler, state); diff --git a/xen-stub.c b/xen-stub.c index 47c8e73..ad189a6 100644 --- a/xen-stub.c +++ b/xen-stub.c @@ -64,7 +64,7 @@ void xen_modified_memory(ram_addr_t start, ram_addr_t length) { } -int xen_hvm_init(void) +int xen_hvm_init(MemoryRegion **ram_memory) { return 0; } -- 1.7.2.5
From: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> --- hw/i386/pc_q35.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index d7b7c3b..464a892 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -76,6 +76,11 @@ static void pc_q35_init(QEMUMachineInitArgs *args) DeviceState *icc_bridge; PcGuestInfo *guest_info; + if (xen_enabled() && xen_hvm_init(&ram_memory) != 0) { + fprintf(stderr, "xen hardware virtual machine initialisation failed\n"); + exit(1); + } + icc_bridge = qdev_create(NULL, TYPE_ICC_BRIDGE); object_property_add_child(qdev_get_machine(), "icc-bridge", OBJECT(icc_bridge), NULL); -- 1.7.2.5