xen/ioemu-9869-MSI-X-init.patch
Charles Arnold 7f6bd728fd - bnc#745880 - cpuid setting is not preserved across xend restarts
xend-cpuid.patch

- Rename 2XXXX-vif-bridge.patch -> vif-bridge-tap-fix.patch

- bnc#747331 - XEN: standard "newburn" kernel QA stress test on guest
  (+ smartd on Dom0?) freezes the guest
  24883-x86-guest-walk-not-present.patch
- bnc#745367 - MCE bank handling during migration
  24781-x86-vmce-mcg_ctl.patch
  24886-x86-vmce-mcg_ctl-default.patch
  24887-x86-vmce-sr.patch
- bnc#744771 - L3: VM with passed through PCI card fails to reboot
  under dom0 load
  24888-pci-release-devices.patch
- Upstream patches from Jan
  24517-VT-d-fault-softirq.patch
  24527-AMD-Vi-fault-softirq.patch
  24535-x86-vMSI-misc.patch
  24615-VESA-lfb-flush.patch
  24690-x86-PCI-SERR-no-deadlock.patch
  24701-gnttab-map-grant-ref-recovery.patch
  24742-gnttab-misc.patch
  24780-x86-paging-use-clear_guest.patch
  24805-x86-MSI-X-dom0-ro.patch
  ioemu-9869-MSI-X-init.patch
  ioemu-9873-MSI-X-fix-unregister_iomem.patch

- bnc#745005 - Update vif configuration examples in xmexample*
  Updated xen-xmexample.diff

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=172
2012-03-05 20:59:08 +00:00

54 lines
2.0 KiB
Diff

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1325783746 0
# Node ID db6c7b83d4165ada5498339b87031a09f5b79d8a
# Parent 11ca857d983420a9f54e4d0e6919f8e6bd5fca48
qemu-xen: fix sequence of operations in pt_msix_init()
Checking the return value of mmap() must be done before adjusting the
value, otherwise failure may not be detected.
Closing the file handle, on the other hand, can be done before checking
the return value.
Finally, printing the errno value without knowing whether the previous
function actually failed is bogus (and superfluous since a subsequent
message prints the strerror() representaton anyway).
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
committer: Ian Jackson <Ian.Jackson@eu.citrix.com>
--- a/tools/ioemu-qemu-xen/hw/pt-msi.c
+++ b/tools/ioemu-qemu-xen/hw/pt-msi.c
@@ -537,7 +537,6 @@ int pt_msix_init(struct pt_dev *dev, int
int i, total_entries, table_off, bar_index;
struct pci_dev *pd = dev->pci_dev;
int fd;
- int err;
id = pci_read_byte(pd, pos + PCI_CAP_LIST_ID);
@@ -585,17 +584,14 @@ int pt_msix_init(struct pt_dev *dev, int
dev->msix->phys_iomem_base = mmap(0, total_entries * 16 + dev->msix->table_offset_adjust,
PROT_READ, MAP_SHARED | MAP_LOCKED,
fd, dev->msix->table_base + table_off - dev->msix->table_offset_adjust);
- dev->msix->phys_iomem_base = (void *)((char *)dev->msix->phys_iomem_base +
- dev->msix->table_offset_adjust);
- err = errno;
- PT_LOG("errno = %d\n",err);
+ close(fd);
if ( dev->msix->phys_iomem_base == MAP_FAILED )
{
PT_LOG("Error: Can't map physical MSI-X table: %s\n", strerror(errno));
- close(fd);
goto error_out;
}
- close(fd);
+
+ dev->msix->phys_iomem_base += dev->msix->table_offset_adjust;
PT_LOG("mapping physical MSI-X table to %lx\n",
(unsigned long)dev->msix->phys_iomem_base);