diff options
author | 2008-11-07 18:13:13 +0800 | |
---|---|---|
committer | 2008-11-09 12:07:17 +0200 | |
commit | 198dc96015f0452404333dcb1a795b565a453ca9 (patch) | |
tree | e8144a4f381dd4f181aee9121348983a544b1a6a /hw/ipf.c | |
parent | Fix "pci_add" command info descriptor (diff) | |
download | qemu-kvm-198dc96015f0452404333dcb1a795b565a453ca9.tar.gz qemu-kvm-198dc96015f0452404333dcb1a795b565a453ca9.tar.bz2 qemu-kvm-198dc96015f0452404333dcb1a795b565a453ca9.zip |
Enable device assignment for ia64
kvm/ia64 have supported vt-d support from 2.6.28rc1, this patch
enables its userspace's support.
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'hw/ipf.c')
-rw-r--r-- | hw/ipf.c | 25 |
1 files changed, 24 insertions, 1 deletions
@@ -38,6 +38,7 @@ #include "firmware.h" #include "ia64intrin.h" #include <unistd.h> +#include "device-assignment.h" #include "qemu-kvm.h" @@ -450,7 +451,6 @@ static void ipf_init1(ram_addr_t ram_size, int vga_ram_size, /*Load firware to its proper position.*/ if (kvm_enabled()) { - int r; unsigned long image_size; char *image = NULL; uint8_t *fw_image_start; @@ -645,6 +645,24 @@ static void ipf_init1(ram_addr_t ram_size, int vga_ram_size, unit_id++; } } + +#ifdef USE_KVM_DEVICE_ASSIGNMENT + if (kvm_enabled()) { + int i; + for (i = 0; i < assigned_devices_index; i++) { + if (add_assigned_device(assigned_devices[i]) < 0) { + fprintf(stderr, "Warning: could not add assigned device %s\n", + assigned_devices[i]); + } + } + + if (init_all_assigned_devices(pci_bus)) { + fprintf(stderr, "Failed to initialize assigned devices\n"); + exit (1); + } + } +#endif /* USE_KVM_DEVICE_ASSIGNMENT */ + } static void ipf_init_pci(ram_addr_t ram_size, int vga_ram_size, @@ -695,3 +713,8 @@ void ioapic_set_irq(void *opaque, int irq_num, int level) return; } } + +int ipf_map_irq(PCIDevice *pci_dev, int irq_num) +{ + return ioapic_map_irq(pci_dev->devfn, irq_num); +} |