diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2013-06-25 14:14:00 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-06-25 14:14:00 -0500 |
commit | 1e5b86804ca34913cf5bec5c1240659645774a4e (patch) | |
tree | 6f0c9e83734382332ac0769927a68d1d7a5c963b | |
parent | baf8673ca802cb3ea2cdbe94813441d23bde223b (diff) | |
parent | 39ae4972390f78f8891a355545c56d20a9fb7770 (diff) |
Merge remote-tracking branch 'sstabellini/xen-20130625' into staging
# By Paul Durrant (2) and Stefano Stabellini (1)
# Via Stefano Stabellini
* sstabellini/xen-20130625:
Move hardcoded initialization of xen-platform device.
Allow use of pc machine type (accel=xen) for Xen HVM domains.
Revert "xen: start PCI hole at 0xe0000000 (same as pc_init1 and qemu-xen-traditional)"
Message-id: alpine.DEB.2.02.1306251323220.4782@kaball.uk.xensource.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r-- | hw/i386/pc_piix.c | 24 | ||||
-rw-r--r-- | include/hw/i386/pc.h | 3 | ||||
-rw-r--r-- | xen-all.c | 12 | ||||
-rw-r--r-- | xen-stub.c | 5 |
4 files changed, 26 insertions, 18 deletions
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 7972443374..fa59a0cb26 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -91,6 +91,11 @@ static void pc_init1(MemoryRegion *system_memory, DeviceState *icc_bridge; FWCfgState *fw_cfg = NULL; + if (xen_enabled() && xen_hvm_init() != 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); @@ -102,9 +107,9 @@ static void pc_init1(MemoryRegion *system_memory, kvmclock_create(); } - if (ram_size >= QEMU_BELOW_4G_RAM_END ) { - above_4g_mem_size = ram_size - QEMU_BELOW_4G_RAM_END; - below_4g_mem_size = QEMU_BELOW_4G_RAM_END; + if (ram_size >= 0xe0000000 ) { + above_4g_mem_size = ram_size - 0xe0000000; + below_4g_mem_size = 0xe0000000; } else { above_4g_mem_size = 0; below_4g_mem_size = ram_size; @@ -174,9 +179,6 @@ static void pc_init1(MemoryRegion *system_memory, pc_register_ferr_irq(gsi[13]); pc_vga_init(isa_bus, pci_enabled ? pci_bus : NULL); - if (xen_enabled()) { - pci_create_simple(pci_bus, -1, "xen-platform"); - } /* init basic PC hardware */ pc_basic_device_init(isa_bus, gsi, &rtc_state, &floppy, xen_enabled()); @@ -320,10 +322,14 @@ static void pc_init_isa(QEMUMachineInitArgs *args) #ifdef CONFIG_XEN static void pc_xen_hvm_init(QEMUMachineInitArgs *args) { - if (xen_hvm_init() != 0) { - hw_error("xen hardware virtual machine initialisation failed"); - } + PCIBus *bus; + pc_init_pci(args); + + bus = pci_find_root_bus(0); + if (bus != NULL) { + pci_create_simple(bus, -1, "xen-platform"); + } } #endif diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 7f0496764c..a417402bbb 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -79,9 +79,6 @@ extern int fd_bootchk; void pc_register_ferr_irq(qemu_irq irq); void pc_acpi_smi_interrupt(void *opaque, int irq, int level); -#define QEMU_BELOW_4G_RAM_END 0xe0000000 -#define QEMU_BELOW_4G_MMIO_LENGTH ((1ULL << 32) - QEMU_BELOW_4G_RAM_END) - void pc_cpus_init(const char *cpu_model, DeviceState *icc_bridge); void pc_hot_add_cpu(const int64_t id, Error **errp); void pc_acpi_init(const char *default_dsdt); @@ -161,18 +161,18 @@ static void xen_ram_init(ram_addr_t ram_size) ram_addr_t block_len; block_len = ram_size; - if (ram_size >= QEMU_BELOW_4G_RAM_END) { + if (ram_size >= HVM_BELOW_4G_RAM_END) { /* Xen does not allocate the memory continuously, and keep a hole at - * QEMU_BELOW_4G_RAM_END of QEMU_BELOW_4G_MMIO_LENGTH + * HVM_BELOW_4G_MMIO_START of HVM_BELOW_4G_MMIO_LENGTH */ - block_len += QEMU_BELOW_4G_MMIO_LENGTH; + block_len += HVM_BELOW_4G_MMIO_LENGTH; } memory_region_init_ram(&ram_memory, "xen.ram", block_len); vmstate_register_ram_global(&ram_memory); - if (ram_size >= QEMU_BELOW_4G_RAM_END) { - above_4g_mem_size = ram_size - QEMU_BELOW_4G_RAM_END; - below_4g_mem_size = QEMU_BELOW_4G_RAM_END; + if (ram_size >= HVM_BELOW_4G_RAM_END) { + above_4g_mem_size = ram_size - HVM_BELOW_4G_RAM_END; + below_4g_mem_size = HVM_BELOW_4G_RAM_END; } else { below_4g_mem_size = ram_size; } diff --git a/xen-stub.c b/xen-stub.c index 6f0516aa3e..47c8e73e0f 100644 --- a/xen-stub.c +++ b/xen-stub.c @@ -63,3 +63,8 @@ void qmp_xen_set_global_dirty_log(bool enable, Error **errp) void xen_modified_memory(ram_addr_t start, ram_addr_t length) { } + +int xen_hvm_init(void) +{ + return 0; +} |