[xen/f17] add upstream patch for PCI passthrough problems after XSA-46

myoung myoung at fedoraproject.org
Mon Jun 24 21:49:18 UTC 2013


commit 9b6f8165dd2a8e004fecbea114c108a8186019fb
Author: Michael Young <m.a.young at durham.ac.uk>
Date:   Mon Jun 24 22:45:38 2013 +0100

    add upstream patch for PCI passthrough problems after XSA-46

 ...-934a5253d932b6f67fe40fc48975a2b0117e4cce.patch |   68 ++++++++++++++++++++
 xen.spec                                           |    9 ++-
 2 files changed, 75 insertions(+), 2 deletions(-)
---
diff --git a/xen.git-934a5253d932b6f67fe40fc48975a2b0117e4cce.patch b/xen.git-934a5253d932b6f67fe40fc48975a2b0117e4cce.patch
new file mode 100644
index 0000000..e35be52
--- /dev/null
+++ b/xen.git-934a5253d932b6f67fe40fc48975a2b0117e4cce.patch
@@ -0,0 +1,68 @@
+From 934a5253d932b6f67fe40fc48975a2b0117e4cce Mon Sep 17 00:00:00 2001
+From: Jan Beulich <jbeulich at suse.com>
+Date: Tue, 21 May 2013 11:32:34 +0200
+Subject: [PATCH] fix XSA-46 regression with xend/xm
+
+The hypervisor side changes for XSA-46 require the tool stack to now
+always map the guest pIRQ before granting access permission to the
+underlying host IRQ (GSI). This in particular requires that pciif.py
+no longer can skip this step (assuming qemu would do it) for HVM
+guests.
+
+This in turn exposes, however, an inconsistency between xend and qemu:
+The former wants to always establish 1:1 mappings between pIRQ and host
+IRQ (for non-MSI only of course), while the latter always wants to
+allocate an arbitrary mapping. Since the whole tool stack obviously
+should always agree on the mapping model, make libxc enforce the 1:1
+mapping as the more natural one (as well as being the one that allows
+for easier debugging, since there no need to find out the extra
+mapping). Users of libxc that want to establish a particular (rather
+than an allocated) mapping are still free to do so, as well as tool
+stacks not based on libxc wanting to implement an allocation based
+model (which is why it's not the hypervisor that's being changed to
+enforce either model).
+
+Since libxl, like xend, already uses a 1:1 model, it's unaffected by
+the libxc change (and it being unaffected by the original hypervisor
+side changes is - afaict - simply due to qemu getting spawned at a
+later point in time compared to the xend event flow).
+
+Signed-off-by: Jan Beulich <jbeulich at suse.com>
+Tested-by: Andreas Falck <falck.andreas.lists at gmail.com> (on 4.1)
+Tested-by: Gordan Bobic <gordan at bobich.net> (on 4.2)
+Acked-by: Ian Campbell <ian.campbell at citrix.com>
+Reviewed-by: Andrew Cooper <andrew.cooper3 at citrix.com>
+---
+ tools/libxc/xc_physdev.c              |    2 +-
+ tools/python/xen/xend/server/pciif.py |    2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tools/libxc/xc_physdev.c b/tools/libxc/xc_physdev.c
+index bdbcba7..cf02d85 100644
+--- a/tools/libxc/xc_physdev.c
++++ b/tools/libxc/xc_physdev.c
+@@ -49,7 +49,7 @@ int xc_physdev_map_pirq(xc_interface *xch,
+     map.domid = domid;
+     map.type = MAP_PIRQ_TYPE_GSI;
+     map.index = index;
+-    map.pirq = *pirq;
++    map.pirq = *pirq < 0 ? index : *pirq;
+ 
+     rc = do_physdev_op(xch, PHYSDEVOP_map_pirq, &map, sizeof(map));
+ 
+diff --git a/tools/python/xen/xend/server/pciif.py b/tools/python/xen/xend/server/pciif.py
+index 43d0c80..27c1b75 100644
+--- a/tools/python/xen/xend/server/pciif.py
++++ b/tools/python/xen/xend/server/pciif.py
+@@ -340,7 +340,7 @@ class PciController(DevController):
+                 raise VmError(('pci: failed to configure I/O memory on device '+
+                             '%s - errno=%d')%(dev.name,rc))
+ 
+-        if not self.vm.info.is_hvm() and dev.irq:
++        if dev.irq > 0:
+             rc = xc.physdev_map_pirq(domid = fe_domid,
+                                    index = dev.irq,
+                                    pirq  = dev.irq)
+-- 
+1.7.2.5
+
diff --git a/xen.spec b/xen.spec
index 79be0be..9296378 100644
--- a/xen.spec
+++ b/xen.spec
@@ -20,7 +20,7 @@
 Summary: Xen is a virtual machine monitor
 Name:    xen
 Version: 4.1.5
-Release: 7%{?dist}
+Release: 8%{?dist}
 Group:   Development/Libraries
 License: GPLv2+ and LGPLv2+ and BSD
 URL:     http://xen.org/
@@ -107,6 +107,7 @@ Patch91: xsa55-4.10019-libxc-check-return-values-from-malloc.patch
 Patch92: xsa55-4.10020-libxc-range-checks-in-xc_dom_p2m_host-and-_guest.patch
 Patch93: xsa55-4.10021-libxc-check-blob-size-before-proceeding-in-xc_dom_ch.patch
 Patch94: xsa57-4.1.patch
+Patch95: xen.git-934a5253d932b6f67fe40fc48975a2b0117e4cce.patch
 
 Patch100: xen-configure-xend.patch
 
@@ -300,6 +301,7 @@ manage Xen virtual machines.
 %patch92 -p1
 %patch93 -p1
 %patch94 -p1
+%patch95 -p1
 
 %patch100 -p1
 
@@ -758,8 +760,11 @@ rm -rf %{buildroot}
 %endif
 
 %changelog
+* Mon Jun 24 2013 Michael Young <m.a.young at durham.ac.uk> - 4.1.5-8
+- add upstream patch for PCI passthrough problems after XSA-46
+
 * Fri Jun 21 2013 Michael Young <m.a.young at durham.ac.uk> - 4.1.5-7
-- - xenstore permissions not set correctly by libxl [XSA-57] (#976779)
+- xenstore permissions not set correctly by libxl [XSA-57] (#976779)
 
 * Fri Jun 14 2013 Michael Young <m.a.young at durham.ac.uk> - 4.1.5-6
 - Revised fixes for [XSA-55, CVE-2013-2194 CVE-2013-2195


More information about the scm-commits mailing list