From patchwork Wed Aug 12 04:00:05 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Xiantao" X-Patchwork-Id: 40793 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7C40eN6026763 for ; Wed, 12 Aug 2009 04:00:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750770AbZHLEAg (ORCPT ); Wed, 12 Aug 2009 00:00:36 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750796AbZHLEAg (ORCPT ); Wed, 12 Aug 2009 00:00:36 -0400 Received: from mga14.intel.com ([143.182.124.37]:21812 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750741AbZHLEAf (ORCPT ); Wed, 12 Aug 2009 00:00:35 -0400 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 11 Aug 2009 21:00:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.43,365,1246863600"; d="scan'208,223";a="174831641" Received: from pgsmsx603.gar.corp.intel.com ([10.221.43.87]) by azsmga001.ch.intel.com with ESMTP; 11 Aug 2009 21:00:34 -0700 Received: from pdsmsx602.ccr.corp.intel.com (172.16.12.184) by pgsmsx603.gar.corp.intel.com (10.221.43.87) with Microsoft SMTP Server (TLS) id 8.1.358.0; Wed, 12 Aug 2009 12:00:09 +0800 Received: from pdsmsx503.ccr.corp.intel.com ([172.16.12.95]) by pdsmsx602.ccr.corp.intel.com ([172.16.12.184]) with mapi; Wed, 12 Aug 2009 12:00:08 +0800 From: "Zhang, Xiantao" To: "avi@redhat.com" CC: "kvm-ia64@vger.kernel.org" , "kvm@vger.kernel.org" Date: Wed, 12 Aug 2009 12:00:05 +0800 Subject: [PATCH] qemu-kvm: ia64 build fix. Thread-Topic: [PATCH] qemu-kvm: ia64 build fix. Thread-Index: AcobAWBZTvFzZ3X7T8iFh7EFfmvEXg== Message-ID: <706158FABBBA044BAD4FE898A02E4BC201C04E63D1@pdsmsx503.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From 7ae1cc3ac39e920ecd553902a5f578af8cdb383c Mon Sep 17 00:00:00 2001 From: Xiantao Zhang Date: Wed, 12 Aug 2009 10:48:18 +0800 Subject: [PATCH] qemu-kvm: ia64 build fix. fixed missing part for ipf due to common changes. Signed-off-by: Xiantao Zhang --- configure | 7 ---- hw/ipf.c | 75 ++++++++++++++++++++++++++++------------------ target-ia64/cpu.h | 2 - target-ia64/translate.c | 13 +++++--- 4 files changed, 54 insertions(+), 43 deletions(-) diff --git a/configure b/configure index 84af8bd..719d26a 100755 --- a/configure +++ b/configure @@ -2383,13 +2383,6 @@ if test "$target_linux_user" = "yes" -o "$target_bsd_user" = "yes" ; then ;; esac fi -if test "$target_softmmu" = "yes" ; then - case "$ARCH" in - ia64) - ldflags="-Wl,-G0 $linker_script -static $ldflags" - ;; - esac -fi echo "LDFLAGS+=$ldflags" >> $config_mak echo "QEMU_CFLAGS+=$cflags" >> $config_mak diff --git a/hw/ipf.c b/hw/ipf.c index 04b7b2c..dbbee13 100644 --- a/hw/ipf.c +++ b/hw/ipf.c @@ -50,6 +50,8 @@ #define MAX_IDE_BUS 2 +char bios_dir[]= "/usr/local/share/qemu"; + static fdctrl_t *floppy_controller; static RTCState *rtc_state; static PCIDevice *i440fx_state; @@ -372,12 +374,20 @@ static void pc_init_ne2k_isa(NICInfo *nd, qemu_irq *pic) nb_ne2k++; } +enum { + COMPAT_DEFAULT = 0, + COMPAT_0_10, /* compatible with qemu 0.10.x */ +}; + /* Itanium hardware initialisation */ 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 *boot_device, + const char *kernel_filename, + const char *kernel_cmdline, const char *initrd_filename, - int pci_enabled, const char *cpu_model) + const char *cpu_model, + int pci_enabled, + int compat_level) { char buf[1024]; int i; @@ -390,10 +400,11 @@ static void ipf_init1(ram_addr_t ram_size, qemu_irq *cpu_irq; qemu_irq *i8259; int page_size; - int index; + DriveInfo *dinfo; unsigned long ipf_legacy_io_base, ipf_legacy_io_mem; BlockDriverState *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; BlockDriverState *fd[MAX_FD]; + const char *virtio_blk_name, *virtio_console_name; page_size = getpagesize(); if (page_size != TARGET_PAGE_SIZE) { @@ -422,7 +433,7 @@ static void ipf_init1(ram_addr_t ram_size, if (i != 0) env->hflags |= HF_HALTED_MASK; register_savevm("cpu", i, 4, cpu_save, cpu_load, env); - qemu_register_reset(main_cpu_reset, 0, env); + qemu_register_reset(main_cpu_reset, env); } /* allocate RAM */ @@ -491,7 +502,7 @@ static void ipf_init1(ram_addr_t ram_size, /*Register legacy io address space, size:64M*/ ipf_legacy_io_base = 0xE0000000; - ipf_legacy_io_mem = cpu_register_io_memory(0, ipf_legacy_io_read, + ipf_legacy_io_mem = cpu_register_io_memory(ipf_legacy_io_read, ipf_legacy_io_write, NULL); cpu_register_physical_memory(ipf_legacy_io_base, 64*1024*1024, ipf_legacy_io_mem); @@ -551,20 +562,15 @@ static void ipf_init1(ram_addr_t ram_size, #ifdef USE_HYPERCALL pci_hypercall_init(pci_bus); #endif - if (drive_get_max_bus(IF_IDE) >= MAX_IDE_BUS) { fprintf(stderr, "qemu: too many IDE bus\n"); exit(1); } for(i = 0; i < MAX_IDE_BUS * MAX_IDE_DEVS; i++) { - index = drive_get_index(IF_IDE, i / MAX_IDE_DEVS, i % MAX_IDE_DEVS); - if (index != -1) - hd[i] = drives_table[index].bdrv; - else - hd[i] = NULL; + dinfo = drive_get(IF_IDE, i / MAX_IDE_DEVS, i % MAX_IDE_DEVS); + hd[i] = dinfo ? dinfo->bdrv : NULL; } - if (pci_enabled) { pci_piix3_ide_init(pci_bus, hd, piix3_devfn + 1, i8259); } else { @@ -581,11 +587,8 @@ static void ipf_init1(ram_addr_t ram_size, #endif for(i = 0; i < MAX_FD; i++) { - index = drive_get_index(IF_FLOPPY, 0, i); - if (index != -1) - fd[i] = drives_table[index].bdrv; - else - fd[i] = NULL; + dinfo = drive_get(IF_FLOPPY, 0, i); + fd[i] = dinfo ? dinfo->bdrv : NULL; } floppy_controller = fdctrl_init(i8259[6], 2, 0, 0x3f0, fd); @@ -604,8 +607,8 @@ static void ipf_init1(ram_addr_t ram_size, for (i = 0; i < 8; i++) { 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_prop_set_uint32(eeprom, "address", 0x50 + i); + qdev_prop_set_ptr(eeprom, "data", eeprom_buf + (i * 256)); qdev_init(eeprom); } } @@ -623,17 +626,30 @@ static void ipf_init1(ram_addr_t ram_size, pci_create_simple(pci_bus, -1, "lsi53c895a"); } } + + switch (compat_level) { + case COMPAT_DEFAULT: + default: + virtio_blk_name = "virtio-blk-pci"; + virtio_console_name = "virtio-console-pci"; + break; + + case COMPAT_0_10: + virtio_blk_name = "virtio-blk-pci-0-10"; + virtio_console_name = "virtio-console-pci-0-10"; + break; + } + /* Add virtio block devices */ if (pci_enabled) { - int index; - int unit_id = 0; + int unit_id = 0; - while ((index = drive_get_index(IF_VIRTIO, 0, unit_id)) != -1) { - pci_dev = pci_create("virtio-blk-pci", - drives_table[index].devaddr); + while ((dinfo = drive_get(IF_VIRTIO, 0, unit_id)) != NULL) { + pci_dev = pci_create(virtio_blk_name, + dinfo->devaddr); qdev_init(&pci_dev->qdev); - unit_id++; - } + unit_id++; + } } #ifdef USE_KVM_DEVICE_ASSIGNMENT @@ -650,8 +666,9 @@ static void ipf_init_pci(ram_addr_t ram_size, const char *initrd_filename, const char *cpu_model) { - ipf_init1(ram_size, boot_device, ds, kernel_filename, - kernel_cmdline, initrd_filename, 1, cpu_model); + ipf_init1(ram_size, boot_device, kernel_filename, + kernel_cmdline, initrd_filename, cpu_model, + 1, COMPAT_DEFAULT); } QEMUMachine ipf_machine = { diff --git a/target-ia64/cpu.h b/target-ia64/cpu.h index fb51463..168ff9b 100644 --- a/target-ia64/cpu.h +++ b/target-ia64/cpu.h @@ -71,8 +71,6 @@ static inline int cpu_mmu_index (CPUState *env) * These ones really should go to the appropriate tcg header file, if/when * tcg support is added for ia64. */ -void tcg_dump_info(FILE *f, - int (*cpu_fprintf)(FILE *f, const char *fmt, ...)); static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc, target_ulong *cs_base, int *flags) diff --git a/target-ia64/translate.c b/target-ia64/translate.c index 86f48f5..28ef7f2 100644 --- a/target-ia64/translate.c +++ b/target-ia64/translate.c @@ -27,13 +27,16 @@ static uint16_t *gen_opc_ptr; #include "cpu.h" #include "exec-all.h" #include "disas.h" -#include "gen-op.h" -int gen_intermediate_code(CPUState *env, TranslationBlock *tb) +void gen_intermediate_code (CPUState *env, struct TranslationBlock *tb) { - return 0; } -int gen_intermediate_code_pc(CPUState *env, TranslationBlock *tb) + +void gen_intermediate_code_pc(CPUState *env, TranslationBlock *tb) +{ +} + +void gen_pc_load(CPUState *env, TranslationBlock *tb, + unsigned long searched_pc, int pc_pos, void *puc) { - return 0; }