|
|
9ae3a8 |
From c12c0b02880f4162cc237f11407532375882b941 Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
Date: Sat, 2 Nov 2013 10:01:18 +0100
|
|
|
9ae3a8 |
Subject: [PATCH 18/29] pc: Don't prematurely explode QEMUMachineInitArgs
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
Message-id: <1383386488-29789-2-git-send-email-armbru@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 55237
|
|
|
9ae3a8 |
O-Subject: [PATCH 7.0 qemu-kvm 01/11] pc: Don't prematurely explode QEMUMachineInitArgs
|
|
|
9ae3a8 |
Bugzilla: 994490
|
|
|
9ae3a8 |
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
From: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Don't explode QEMUMachineInitArgs before passing it to pc_init1().
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit 5650f5f48bfe2a684138505aae008dc4440202f1)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Conflicts:
|
|
|
9ae3a8 |
hw/i386/pc_piix.c
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Maintainer's note: Fixed incorrect change in c_init_pci_no_kvmclock()
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/i386/pc_piix.c | 66 ++++++++++++++-----------------------------------------
|
|
|
9ae3a8 |
1 file changed, 16 insertions(+), 50 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/i386/pc_piix.c | 65 +++++++++++++----------------------------------------
|
|
|
9ae3a8 |
1 files changed, 16 insertions(+), 49 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
|
|
|
9ae3a8 |
index 3a8418e..65f7f3a 100644
|
|
|
9ae3a8 |
--- a/hw/i386/pc_piix.c
|
|
|
9ae3a8 |
+++ b/hw/i386/pc_piix.c
|
|
|
9ae3a8 |
@@ -59,14 +59,9 @@ static const int ide_irq[MAX_IDE_BUS] = { 14, 15 };
|
|
|
9ae3a8 |
static bool has_pvpanic = true;
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
/* PC hardware initialisation */
|
|
|
9ae3a8 |
-static void pc_init1(MemoryRegion *system_memory,
|
|
|
9ae3a8 |
+static void pc_init1(QEMUMachineInitArgs *args,
|
|
|
9ae3a8 |
+ MemoryRegion *system_memory,
|
|
|
9ae3a8 |
MemoryRegion *system_io,
|
|
|
9ae3a8 |
- ram_addr_t ram_size,
|
|
|
9ae3a8 |
- const char *boot_device,
|
|
|
9ae3a8 |
- const char *kernel_filename,
|
|
|
9ae3a8 |
- const char *kernel_cmdline,
|
|
|
9ae3a8 |
- const char *initrd_filename,
|
|
|
9ae3a8 |
- const char *cpu_model,
|
|
|
9ae3a8 |
int pci_enabled,
|
|
|
9ae3a8 |
int kvmclock_enabled)
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
@@ -95,18 +90,18 @@ static void pc_init1(MemoryRegion *system_memory,
|
|
|
9ae3a8 |
object_property_add_child(qdev_get_machine(), "icc-bridge",
|
|
|
9ae3a8 |
OBJECT(icc_bridge), NULL);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
- pc_cpus_init(cpu_model, icc_bridge);
|
|
|
9ae3a8 |
+ pc_cpus_init(args->cpu_model, icc_bridge);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
if (kvmclock_enabled) {
|
|
|
9ae3a8 |
kvmclock_create();
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
- if (ram_size >= QEMU_BELOW_4G_RAM_END ) {
|
|
|
9ae3a8 |
- above_4g_mem_size = ram_size - QEMU_BELOW_4G_RAM_END;
|
|
|
9ae3a8 |
+ if (args->ram_size >= QEMU_BELOW_4G_RAM_END ) {
|
|
|
9ae3a8 |
+ above_4g_mem_size = args->ram_size - QEMU_BELOW_4G_RAM_END;
|
|
|
9ae3a8 |
below_4g_mem_size = QEMU_BELOW_4G_RAM_END;
|
|
|
9ae3a8 |
} else {
|
|
|
9ae3a8 |
above_4g_mem_size = 0;
|
|
|
9ae3a8 |
- below_4g_mem_size = ram_size;
|
|
|
9ae3a8 |
+ below_4g_mem_size = args->ram_size;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
if (pci_enabled) {
|
|
|
9ae3a8 |
@@ -121,7 +116,8 @@ static void pc_init1(MemoryRegion *system_memory,
|
|
|
9ae3a8 |
/* allocate ram and load rom/bios */
|
|
|
9ae3a8 |
if (!xen_enabled()) {
|
|
|
9ae3a8 |
fw_cfg = pc_memory_init(system_memory,
|
|
|
9ae3a8 |
- kernel_filename, kernel_cmdline, initrd_filename,
|
|
|
9ae3a8 |
+ args->kernel_filename, args->kernel_cmdline,
|
|
|
9ae3a8 |
+ args->initrd_filename,
|
|
|
9ae3a8 |
below_4g_mem_size, above_4g_mem_size,
|
|
|
9ae3a8 |
rom_memory, &ram_memory);
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
@@ -137,7 +133,7 @@ static void pc_init1(MemoryRegion *system_memory,
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
if (pci_enabled) {
|
|
|
9ae3a8 |
pci_bus = i440fx_init(&i440fx_state, &piix3_devfn, &isa_bus, gsi,
|
|
|
9ae3a8 |
- system_memory, system_io, ram_size,
|
|
|
9ae3a8 |
+ system_memory, system_io, args->ram_size,
|
|
|
9ae3a8 |
below_4g_mem_size,
|
|
|
9ae3a8 |
0x100000000ULL - below_4g_mem_size,
|
|
|
9ae3a8 |
0x100000000ULL + above_4g_mem_size,
|
|
|
9ae3a8 |
@@ -202,7 +198,7 @@ static void pc_init1(MemoryRegion *system_memory,
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
- pc_cmos_init(below_4g_mem_size, above_4g_mem_size, boot_device,
|
|
|
9ae3a8 |
+ pc_cmos_init(below_4g_mem_size, above_4g_mem_size, args->boot_device,
|
|
|
9ae3a8 |
floppy, idebus[0], idebus[1], rtc_state);
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
if (pci_enabled && usb_enabled(false)) {
|
|
|
9ae3a8 |
@@ -232,17 +228,7 @@ static void pc_init1(MemoryRegion *system_memory,
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
static void pc_init_pci(QEMUMachineInitArgs *args)
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
- ram_addr_t ram_size = args->ram_size;
|
|
|
9ae3a8 |
- const char *cpu_model = args->cpu_model;
|
|
|
9ae3a8 |
- const char *kernel_filename = args->kernel_filename;
|
|
|
9ae3a8 |
- const char *kernel_cmdline = args->kernel_cmdline;
|
|
|
9ae3a8 |
- const char *initrd_filename = args->initrd_filename;
|
|
|
9ae3a8 |
- const char *boot_device = args->boot_device;
|
|
|
9ae3a8 |
- pc_init1(get_system_memory(),
|
|
|
9ae3a8 |
- get_system_io(),
|
|
|
9ae3a8 |
- ram_size, boot_device,
|
|
|
9ae3a8 |
- kernel_filename, kernel_cmdline,
|
|
|
9ae3a8 |
- initrd_filename, cpu_model, 1, 1);
|
|
|
9ae3a8 |
+ pc_init1(args, get_system_memory(), get_system_io(), 1, 1);
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
#if 0 /* Disabled for Red Hat Enterprise Linux */
|
|
|
9ae3a8 |
@@ -283,40 +269,21 @@ static void pc_init_pci_1_0(QEMUMachineInitArgs *args)
|
|
|
9ae3a8 |
/* PC init function for pc-0.10 to pc-0.13, and reused by xenfv */
|
|
|
9ae3a8 |
static void pc_init_pci_no_kvmclock(QEMUMachineInitArgs *args)
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
- ram_addr_t ram_size = args->ram_size;
|
|
|
9ae3a8 |
- const char *cpu_model = args->cpu_model;
|
|
|
9ae3a8 |
- const char *kernel_filename = args->kernel_filename;
|
|
|
9ae3a8 |
- const char *kernel_cmdline = args->kernel_cmdline;
|
|
|
9ae3a8 |
- const char *initrd_filename = args->initrd_filename;
|
|
|
9ae3a8 |
- const char *boot_device = args->boot_device;
|
|
|
9ae3a8 |
has_pvpanic = false;
|
|
|
9ae3a8 |
disable_kvm_pv_eoi();
|
|
|
9ae3a8 |
enable_compat_apic_id_mode();
|
|
|
9ae3a8 |
- pc_init1(get_system_memory(),
|
|
|
9ae3a8 |
- get_system_io(),
|
|
|
9ae3a8 |
- ram_size, boot_device,
|
|
|
9ae3a8 |
- kernel_filename, kernel_cmdline,
|
|
|
9ae3a8 |
- initrd_filename, cpu_model, 1, 0);
|
|
|
9ae3a8 |
+ pc_init1(args, get_system_memory(), get_system_io(), 1, 0);
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
static void pc_init_isa(QEMUMachineInitArgs *args)
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
- ram_addr_t ram_size = args->ram_size;
|
|
|
9ae3a8 |
- const char *cpu_model = args->cpu_model;
|
|
|
9ae3a8 |
- const char *kernel_filename = args->kernel_filename;
|
|
|
9ae3a8 |
- const char *kernel_cmdline = args->kernel_cmdline;
|
|
|
9ae3a8 |
- const char *initrd_filename = args->initrd_filename;
|
|
|
9ae3a8 |
- const char *boot_device = args->boot_device;
|
|
|
9ae3a8 |
has_pvpanic = false;
|
|
|
9ae3a8 |
- if (cpu_model == NULL)
|
|
|
9ae3a8 |
- cpu_model = "486";
|
|
|
9ae3a8 |
+ if (!args->cpu_model) {
|
|
|
9ae3a8 |
+ args->cpu_model = "486";
|
|
|
9ae3a8 |
+ }
|
|
|
9ae3a8 |
disable_kvm_pv_eoi();
|
|
|
9ae3a8 |
enable_compat_apic_id_mode();
|
|
|
9ae3a8 |
- pc_init1(get_system_memory(),
|
|
|
9ae3a8 |
- get_system_io(),
|
|
|
9ae3a8 |
- ram_size, boot_device,
|
|
|
9ae3a8 |
- kernel_filename, kernel_cmdline,
|
|
|
9ae3a8 |
- initrd_filename, cpu_model, 0, 1);
|
|
|
9ae3a8 |
+ pc_init1(args, get_system_memory(), get_system_io(), 0, 1);
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
#ifdef CONFIG_XEN
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.7.1
|
|
|
9ae3a8 |
|