]> git.proxmox.com Git - mirror_qemu.git/commitdiff
Merge remote-tracking branch 'qemu-kvm/uq/master' into staging
authorAnthony Liguori <aliguori@amazon.com>
Thu, 21 Nov 2013 15:09:52 +0000 (07:09 -0800)
committerAnthony Liguori <aliguori@amazon.com>
Thu, 21 Nov 2013 15:09:52 +0000 (07:09 -0800)
# By Jan Kiszka (1) and others
# Via Gleb Natapov
* qemu-kvm/uq/master:
  kvm: Fix uninitialized cpuid_data
  pci-assign: Remove dead code for direct I/O region access from userspace
  KVM: x86: fix typo in KVM_GET_XCRS

Message-id: cover.1385040432.git.gleb@redhat.com
Signed-off-by: Anthony Liguori <aliguori@amazon.com>
1  2 
hw/i386/kvm/pci-assign.c

diff --combined hw/i386/kvm/pci-assign.c
index aae43097aa65c2b5fc57fce317ca637682a046e7,4e651107e1382649f704d2bc330ed2d1a5d2c973..968680104bae7ec9ec81d2162b1ce5cb31a6446e
@@@ -154,55 -154,19 +154,19 @@@ static uint64_t assigned_dev_ioport_rw(
      uint64_t val = 0;
      int fd = dev_region->region->resource_fd;
  
-     if (fd >= 0) {
-         if (data) {
-             DEBUG("pwrite data=%" PRIx64 ", size=%d, e_phys=" TARGET_FMT_plx
-                   ", addr="TARGET_FMT_plx"\n", *data, size, addr, addr);
-             if (pwrite(fd, data, size, addr) != size) {
-                 error_report("%s - pwrite failed %s",
-                              __func__, strerror(errno));
-             }
-         } else {
-             if (pread(fd, &val, size, addr) != size) {
-                 error_report("%s - pread failed %s",
-                              __func__, strerror(errno));
-                 val = (1UL << (size * 8)) - 1;
-             }
-             DEBUG("pread val=%" PRIx64 ", size=%d, e_phys=" TARGET_FMT_plx
-                   ", addr=" TARGET_FMT_plx "\n", val, size, addr, addr);
+     if (data) {
+         DEBUG("pwrite data=%" PRIx64 ", size=%d, e_phys=" TARGET_FMT_plx
+               ", addr="TARGET_FMT_plx"\n", *data, size, addr, addr);
+         if (pwrite(fd, data, size, addr) != size) {
+             error_report("%s - pwrite failed %s", __func__, strerror(errno));
          }
      } else {
-         uint32_t port = addr + dev_region->u.r_baseport;
-         if (data) {
-             DEBUG("out data=%" PRIx64 ", size=%d, e_phys=" TARGET_FMT_plx
-                   ", host=%x\n", *data, size, addr, port);
-             switch (size) {
-             case 1:
-                 outb(*data, port);
-                 break;
-             case 2:
-                 outw(*data, port);
-                 break;
-             case 4:
-                 outl(*data, port);
-                 break;
-             }
-         } else {
-             switch (size) {
-             case 1:
-                 val = inb(port);
-                 break;
-             case 2:
-                 val = inw(port);
-                 break;
-             case 4:
-                 val = inl(port);
-                 break;
-             }
-             DEBUG("in data=%" PRIx64 ", size=%d, e_phys=" TARGET_FMT_plx
-                   ", host=%x\n", val, size, addr, port);
+         if (pread(fd, &val, size, addr) != size) {
+             error_report("%s - pread failed %s", __func__, strerror(errno));
+             val = (1UL << (size * 8)) - 1;
          }
+         DEBUG("pread val=%" PRIx64 ", size=%d, e_phys=" TARGET_FMT_plx
+               ", addr=" TARGET_FMT_plx "\n", val, size, addr, addr);
      }
      return val;
  }
@@@ -791,22 -755,26 +755,22 @@@ static void assign_failed_examine(Assig
          goto fail;
      }
  
 -    error_report("*** The driver '%s' is occupying your device "
 -                 "%04x:%02x:%02x.%x.",
 -                 ns, dev->host.domain, dev->host.bus, dev->host.slot,
 -                 dev->host.function);
 -    error_report("***");
 -    error_report("*** You can try the following commands to free it:");
 -    error_report("***");
 -    error_report("*** $ echo \"%04x %04x\" > /sys/bus/pci/drivers/pci-stub/"
 -                 "new_id", vendor_id, device_id);
 -    error_report("*** $ echo \"%04x:%02x:%02x.%x\" > /sys/bus/pci/drivers/"
 -                 "%s/unbind",
 -                 dev->host.domain, dev->host.bus, dev->host.slot,
 -                 dev->host.function, ns);
 -    error_report("*** $ echo \"%04x:%02x:%02x.%x\" > /sys/bus/pci/drivers/"
 -                 "pci-stub/bind",
 -                 dev->host.domain, dev->host.bus, dev->host.slot,
 -                 dev->host.function);
 -    error_report("*** $ echo \"%04x %04x\" > /sys/bus/pci/drivers/pci-stub"
 -                 "/remove_id", vendor_id, device_id);
 -    error_report("***");
 +    error_printf("*** The driver '%s' is occupying your device "
 +        "%04x:%02x:%02x.%x.\n"
 +        "***\n"
 +        "*** You can try the following commands to free it:\n"
 +        "***\n"
 +        "*** $ echo \"%04x %04x\" > /sys/bus/pci/drivers/pci-stub/new_id\n"
 +        "*** $ echo \"%04x:%02x:%02x.%x\" > /sys/bus/pci/drivers/%s/unbind\n"
 +        "*** $ echo \"%04x:%02x:%02x.%x\" > /sys/bus/pci/drivers/"
 +        "pci-stub/bind\n"
 +        "*** $ echo \"%04x %04x\" > /sys/bus/pci/drivers/pci-stub/remove_id\n"
 +        "***",
 +        ns, dev->host.domain, dev->host.bus, dev->host.slot,
 +        dev->host.function, vendor_id, device_id,
 +        dev->host.domain, dev->host.bus, dev->host.slot, dev->host.function,
 +        ns, dev->host.domain, dev->host.bus, dev->host.slot,
 +        dev->host.function, vendor_id, device_id);
  
      return;