From: Jes Sorensen <jes@sgi.com>
To: kvm-ia64@vger.kernel.org
Subject: [patch] bugfix, make qemu-kvm build and run again on ia64
Date: Fri, 05 Jun 2009 09:01:32 +0000 [thread overview]
Message-ID: <4A28DEEC.1010404@sgi.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 138 bytes --]
Hi,
With the recent changes to APIs in qemu-kvm, this patch makes it build
again on ia64.
This is a showstopper for ia64.
Cheers,
Jes
[-- Attachment #2: 0010-qemu-kvm-build-fix.patch --]
[-- Type: text/x-patch, Size: 5528 bytes --]
Update ipf.c and Makefile.target for QEMU/ia64 to match recent
changes in QEMU.
Signed-off-by: Jes Sorensen <jes@sgi.com>
---
Makefile.target | 7 ++-----
hw/ipf.c | 50 ++++++++++++++++++++++++++------------------------
2 files changed, 28 insertions(+), 29 deletions(-)
Index: qemu-kvm-2/Makefile.target
===================================================================
--- qemu-kvm-2.orig/Makefile.target
+++ qemu-kvm-2/Makefile.target
@@ -633,13 +633,10 @@
endif
ifeq ($(TARGET_BASE_ARCH), ia64)
# Hardware support
-OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
+OBJS+= ide.o pckbd.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
OBJS+= fdc.o mc146818rtc.o serial.o i8259.o ipf.o
OBJS+= cirrus_vga.o parallel.o acpi.o piix_pci.o
-OBJS+= usb-uhci.o smbus_eeprom.o
-# virtio support
-OBJS+= virtio.o virtio-blk.o virtio-balloon.o
-OBJS+= virtio-net.o
+OBJS+= usb-uhci.o
endif
ifeq ($(TARGET_BASE_ARCH), ppc)
CPPFLAGS += -DHAS_AUDIO -DHAS_AUDIO_CHOICE
Index: qemu-kvm-2/hw/ipf.c
===================================================================
--- qemu-kvm-2.orig/hw/ipf.c
+++ qemu-kvm-2/hw/ipf.c
@@ -373,7 +373,7 @@
}
/* Itanium hardware initialisation */
-static void ipf_init1(ram_addr_t ram_size, int vga_ram_size,
+static void ipf_init1(ram_addr_t ram_size,
const char *boot_device, DisplayState *ds,
const char *kernel_filename, const char *kernel_cmdline,
const char *initrd_filename,
@@ -381,7 +381,7 @@
{
char buf[1024];
int i;
- ram_addr_t ram_addr, vga_ram_addr;
+ ram_addr_t ram_addr;
ram_addr_t above_4g_mem_size = 0;
PCIBus *pci_bus;
int piix3_devfn = -1;
@@ -421,7 +421,7 @@
if (i != 0)
env->hflags |= HF_HALTED_MASK;
register_savevm("cpu", i, 4, cpu_save, cpu_load, env);
- qemu_register_reset(main_cpu_reset, env);
+ qemu_register_reset(main_cpu_reset, 0, env);
}
/* allocate RAM */
@@ -440,8 +440,6 @@
ram_addr = qemu_ram_alloc(ram_size);
cpu_register_physical_memory(0, ram_size, ram_addr);
}
- /* allocate VGA RAM */
- vga_ram_addr = qemu_ram_alloc(vga_ram_size);
/* above 4giga memory allocation */
if (above_4g_mem_size > 0) {
@@ -498,7 +496,7 @@
ipf_legacy_io_mem);
cpu_irq = qemu_allocate_irqs(pic_irq_request, first_cpu, 1);
- i8259 = i8259_init(cpu_irq[0]);
+ i8259 = kvm_i8259_init(cpu_irq[0]);
if (pci_enabled) {
pci_bus = i440fx_init(&i440fx_state, i8259);
@@ -509,14 +507,14 @@
if (cirrus_vga_enabled) {
if (pci_enabled)
- pci_cirrus_vga_init(pci_bus, vga_ram_size);
+ pci_cirrus_vga_init(pci_bus);
else
- isa_cirrus_vga_init(vga_ram_size);
+ isa_cirrus_vga_init();
} else {
if (pci_enabled)
- pci_vga_init(pci_bus, vga_ram_size, 0, 0);
+ pci_vga_init(pci_bus, 0, 0);
else
- isa_vga_init(vga_ram_size);
+ isa_vga_init();
}
rtc_state = rtc_init(0x70, i8259[8], 2000);
@@ -603,7 +601,11 @@
/* TODO: Populate SPD eeprom data. */
smbus = piix4_pm_init(pci_bus, piix3_devfn + 3, 0xb100, i8259[9]);
for (i = 0; i < 8; i++) {
- smbus_eeprom_device_init(smbus, 0x50 + i, eeprom_buf + (i * 256));
+ DeviceState *eeprom;
+ eeprom = qdev_create((BusState *)smbus, "smbus-eeprom");
+ qdev_set_prop_int(eeprom, "address", 0x50 + i);
+ qdev_set_prop_ptr(eeprom, "data", eeprom_buf + (i * 256));
+ qdev_init(eeprom);
}
}
@@ -613,19 +615,11 @@
if (pci_enabled) {
int max_bus;
- int bus, unit;
- void *scsi;
+ int bus;
max_bus = drive_get_max_bus(IF_SCSI);
-
for (bus = 0; bus <= max_bus; bus++) {
- scsi = lsi_scsi_init(pci_bus, -1);
- for (unit = 0; unit < LSI_MAX_DEVS; unit++) {
- index = drive_get_index(IF_SCSI, bus, unit);
- if (index == -1)
- continue;
- lsi_scsi_attach(scsi, drives_table[index].bdrv, unit);
- }
+ pci_create_simple(pci_bus, -1, "lsi53c895a");
}
}
/* Add virtio block devices */
@@ -634,7 +628,7 @@
int unit_id = 0;
while ((index = drive_get_index(IF_VIRTIO, 0, unit_id)) != -1) {
- virtio_blk_init(pci_bus, drives_table[index].bdrv);
+ pci_create_simple(pci_bus, -1, "virtio-blk-pci");
unit_id++;
}
}
@@ -646,14 +640,14 @@
}
-static void ipf_init_pci(ram_addr_t ram_size, int vga_ram_size,
+static void ipf_init_pci(ram_addr_t ram_size,
const char *boot_device, DisplayState *ds,
const char *kernel_filename,
const char *kernel_cmdline,
const char *initrd_filename,
const char *cpu_model)
{
- ipf_init1(ram_size, vga_ram_size, boot_device, ds, kernel_filename,
+ ipf_init1(ram_size, boot_device, ds, kernel_filename,
kernel_cmdline, initrd_filename, 1, cpu_model);
}
@@ -662,8 +656,16 @@
.desc = "Itanium Platform",
.init = (QEMUMachineInitFunc *)ipf_init_pci,
.max_cpus = 255,
+ .is_default = 1,
};
+static void ipf_machine_init(void)
+{
+ qemu_register_machine(&ipf_machine);
+}
+
+machine_init(ipf_machine_init);
+
#define IOAPIC_NUM_PINS 48
static int ioapic_irq_count[IOAPIC_NUM_PINS];
next reply other threads:[~2009-06-05 9:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-05 9:01 Jes Sorensen [this message]
2009-06-07 6:26 ` [patch] bugfix, make qemu-kvm build and run again on ia64 Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A28DEEC.1010404@sgi.com \
--to=jes@sgi.com \
--cc=kvm-ia64@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.