~ubuntu-branches/ubuntu/trusty/qemu/trusty

« back to all changes in this revision

Viewing changes to hw/xen/xen_pt.c

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2013-10-22 22:47:07 UTC
  • mfrom: (1.8.3) (10.1.42 sid)
  • Revision ID: package-import@ubuntu.com-20131022224707-1lya34fw3k3f24tv
Tags: 1.6.0+dfsg-2ubuntu1
* Merge 1.6.0~rc0+dfsg-2exp from debian experimental.  Remaining changes:
  - debian/control
    * update maintainer
    * remove libiscsi, usb-redir, vde, vnc-jpeg, and libssh2-1-dev
      from build-deps
    * enable rbd
    * add qemu-system and qemu-common B/R to qemu-keymaps
    * add D:udev, R:qemu, R:qemu-common and B:qemu-common to
      qemu-system-common
    * qemu-system-arm, qemu-system-ppc, qemu-system-sparc:
      - add qemu-kvm to Provides
      - add qemu-common, qemu-kvm, kvm to B/R
      - remove openbios-sparc from qemu-system-sparc D
      - drop openbios-ppc and openhackware Depends to Suggests (for now)
    * qemu-system-x86:
      - add qemu-common to Breaks/Replaces.
      - add cpu-checker to Recommends.
    * qemu-user: add B/R:qemu-kvm
    * qemu-kvm:
      - add armhf armel powerpc sparc to Architecture
      - C/R/P: qemu-kvm-spice
    * add qemu-common package
    * drop qemu-slof which is not packaged in ubuntu
  - add qemu-system-common.links for tap ifup/down scripts and OVMF link.
  - qemu-system-x86.links:
    * remove pxe rom links which are in kvm-ipxe
    * add symlink for kvm.1 manpage
  - debian/rules
    * add kvm-spice symlink to qemu-kvm
    * call dh_installmodules for qemu-system-x86
    * update dh_installinit to install upstart script
    * run dh_installman (Closes: #709241) (cherrypicked from 1.5.0+dfsg-2)
  - Add qemu-utils.links for kvm-* symlinks.
  - Add qemu-system-x86.qemu-kvm.upstart and .default
  - Add qemu-system-x86.modprobe to set nesting=1
  - Add qemu-system-common.preinst to add kvm group
  - qemu-system-common.postinst: remove bad group acl if there, then have
    udev relabel /dev/kvm.
  - New linaro patches from qemu-linaro rebasing branch
  - Dropped patches:
    * xen-simplify-xen_enabled.patch
    * sparc-linux-user-fix-missing-symbols-in-.rel-.rela.plt-sections.patch
    * main_loop-do-not-set-nonblocking-if-xen_enabled.patch
    * xen_machine_pv-do-not-create-a-dummy-CPU-in-machine-.patch
    * virtio-rng-fix-crash
  - Kept patches:
    * expose_vms_qemu64cpu.patch - updated
    * linaro arm patches from qemu-linaro rebasing branch
  - New patches:
    * fix-pci-add: change CONFIG variable in ifdef to make sure that
      pci_add is defined.
* Add linaro patches
* Add experimental mach-virt patches for arm virtualization.
* qemu-system-common.install: add debian/tmp/usr/lib to install the
  qemu-bridge-helper

Show diffs side-by-side

added added

removed removed

Lines of Context:
416
416
            }
417
417
        }
418
418
 
419
 
        memory_region_init_io(&s->bar[i], &ops, &s->dev,
 
419
        memory_region_init_io(&s->bar[i], OBJECT(s), &ops, &s->dev,
420
420
                              "xen-pci-pt-bar", r->size);
421
421
        pci_register_bar(&s->dev, i, type, &s->bar[i]);
422
422
 
440
440
 
441
441
        s->bases[PCI_ROM_SLOT].access.maddr = d->rom.base_addr;
442
442
 
443
 
        memory_region_init_rom_device(&s->rom, NULL, NULL,
 
443
        memory_region_init_rom_device(&s->rom, OBJECT(s), NULL, NULL,
444
444
                                      "xen-pci-pt-rom", d->rom.size);
445
445
        pci_register_bar(&s->dev, PCI_ROM_SLOT, PCI_BASE_ADDRESS_MEM_PREFETCH,
446
446
                         &s->rom);
547
547
    struct CheckBarArgs args = {
548
548
        .s = s,
549
549
        .addr = sec->offset_within_address_space,
550
 
        .size = sec->size,
 
550
        .size = int128_get64(sec->size),
551
551
        .rc = false,
552
552
    };
553
553
 
576
576
    if (d->io_regions[bar].type & PCI_BASE_ADDRESS_SPACE_IO) {
577
577
        uint32_t guest_port = sec->offset_within_address_space;
578
578
        uint32_t machine_port = s->bases[bar].access.pio_base;
579
 
        uint32_t size = sec->size;
 
579
        uint32_t size = int128_get64(sec->size);
580
580
        rc = xc_domain_ioport_mapping(xen_xc, xen_domid,
581
581
                                      guest_port, machine_port, size,
582
582
                                      op);
588
588
        pcibus_t guest_addr = sec->offset_within_address_space;
589
589
        pcibus_t machine_addr = s->bases[bar].access.maddr
590
590
            + sec->offset_within_region;
591
 
        pcibus_t size = sec->size;
 
591
        pcibus_t size = int128_get64(sec->size);
592
592
        rc = xc_domain_memory_mapping(xen_xc, xen_domid,
593
593
                                      XEN_PFN(guest_addr + XC_PAGE_SIZE - 1),
594
594
                                      XEN_PFN(machine_addr + XC_PAGE_SIZE - 1),
606
606
    XenPCIPassthroughState *s = container_of(l, XenPCIPassthroughState,
607
607
                                             memory_listener);
608
608
 
 
609
    memory_region_ref(sec->mr);
609
610
    xen_pt_region_update(s, sec, true);
610
611
}
611
612
 
615
616
                                             memory_listener);
616
617
 
617
618
    xen_pt_region_update(s, sec, false);
 
619
    memory_region_unref(sec->mr);
618
620
}
619
621
 
620
622
static void xen_pt_io_region_add(MemoryListener *l, MemoryRegionSection *sec)
622
624
    XenPCIPassthroughState *s = container_of(l, XenPCIPassthroughState,
623
625
                                             io_listener);
624
626
 
 
627
    memory_region_ref(sec->mr);
625
628
    xen_pt_region_update(s, sec, true);
626
629
}
627
630
 
631
634
                                             io_listener);
632
635
 
633
636
    xen_pt_region_update(s, sec, false);
 
637
    memory_region_unref(sec->mr);
634
638
}
635
639
 
636
640
static const MemoryListener xen_pt_memory_listener = {
752
756
out:
753
757
    memory_listener_register(&s->memory_listener, &address_space_memory);
754
758
    memory_listener_register(&s->io_listener, &address_space_io);
755
 
    XEN_PT_LOG(d, "Real physical device %02x:%02x.%d registered successfuly!\n",
 
759
    XEN_PT_LOG(d,
 
760
               "Real physical device %02x:%02x.%d registered successfully!\n",
756
761
               s->hostaddr.bus, s->hostaddr.slot, s->hostaddr.function);
757
762
 
758
763
    return 0;
825
830
    k->exit = xen_pt_unregister_device;
826
831
    k->config_read = xen_pt_pci_read_config;
827
832
    k->config_write = xen_pt_pci_write_config;
 
833
    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
828
834
    dc->desc = "Assign an host PCI device with Xen";
829
835
    dc->props = xen_pci_passthrough_properties;
830
836
};