aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2013-05-23 15:16:44 +0200
committerJan Beulich <jbeulich@suse.com>2013-05-23 15:16:44 +0200
commit22d89f4a0960ee07f55da153b8f35e0b4389e029 (patch)
treee5dc9a2c2bddafd513794a95713c394ec44b7dbe
parenta7dcae35f14db7d36bca7a5fbecfea468da152e4 (diff)
downloadxen-22d89f4a0960ee07f55da153b8f35e0b4389e029.tar.gz
xen-22d89f4a0960ee07f55da153b8f35e0b4389e029.tar.bz2
xen-22d89f4a0960ee07f55da153b8f35e0b4389e029.zip
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@suse.com> Tested-by: Andreas Falck <falck.andreas.lists@gmail.com> (on 4.1) Tested-by: Gordan Bobic <gordan@bobich.net> (on 4.2) Acked-by: Ian Campbell <ian.campbell@citrix.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> master commit: 934a5253d932b6f67fe40fc48975a2b0117e4cce master date: 2013-05-21 11:32:34 +0200
-rw-r--r--tools/libxc/xc_physdev.c2
-rw-r--r--tools/python/xen/xend/server/pciif.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/tools/libxc/xc_physdev.c b/tools/libxc/xc_physdev.c
index bdbcba7b3c..cf02d85e6d 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 43d0c80c2a..27c1b75cfc 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)