|
|
cf7baf5 |
From 934a5253d932b6f67fe40fc48975a2b0117e4cce Mon Sep 17 00:00:00 2001
|
|
|
cf7baf5 |
From: Jan Beulich <jbeulich@suse.com>
|
|
|
cf7baf5 |
Date: Tue, 21 May 2013 11:32:34 +0200
|
|
|
cf7baf5 |
Subject: [PATCH] fix XSA-46 regression with xend/xm
|
|
|
cf7baf5 |
|
|
|
cf7baf5 |
The hypervisor side changes for XSA-46 require the tool stack to now
|
|
|
cf7baf5 |
always map the guest pIRQ before granting access permission to the
|
|
|
cf7baf5 |
underlying host IRQ (GSI). This in particular requires that pciif.py
|
|
|
cf7baf5 |
no longer can skip this step (assuming qemu would do it) for HVM
|
|
|
cf7baf5 |
guests.
|
|
|
cf7baf5 |
|
|
|
cf7baf5 |
This in turn exposes, however, an inconsistency between xend and qemu:
|
|
|
cf7baf5 |
The former wants to always establish 1:1 mappings between pIRQ and host
|
|
|
cf7baf5 |
IRQ (for non-MSI only of course), while the latter always wants to
|
|
|
cf7baf5 |
allocate an arbitrary mapping. Since the whole tool stack obviously
|
|
|
cf7baf5 |
should always agree on the mapping model, make libxc enforce the 1:1
|
|
|
cf7baf5 |
mapping as the more natural one (as well as being the one that allows
|
|
|
cf7baf5 |
for easier debugging, since there no need to find out the extra
|
|
|
cf7baf5 |
mapping). Users of libxc that want to establish a particular (rather
|
|
|
cf7baf5 |
than an allocated) mapping are still free to do so, as well as tool
|
|
|
cf7baf5 |
stacks not based on libxc wanting to implement an allocation based
|
|
|
cf7baf5 |
model (which is why it's not the hypervisor that's being changed to
|
|
|
cf7baf5 |
enforce either model).
|
|
|
cf7baf5 |
|
|
|
cf7baf5 |
Since libxl, like xend, already uses a 1:1 model, it's unaffected by
|
|
|
cf7baf5 |
the libxc change (and it being unaffected by the original hypervisor
|
|
|
cf7baf5 |
side changes is - afaict - simply due to qemu getting spawned at a
|
|
|
cf7baf5 |
later point in time compared to the xend event flow).
|
|
|
cf7baf5 |
|
|
|
cf7baf5 |
Signed-off-by: Jan Beulich <jbeulich@suse.com>
|
|
|
cf7baf5 |
Tested-by: Andreas Falck <falck.andreas.lists@gmail.com> (on 4.1)
|
|
|
cf7baf5 |
Tested-by: Gordan Bobic <gordan@bobich.net> (on 4.2)
|
|
|
cf7baf5 |
Acked-by: Ian Campbell <ian.campbell@citrix.com>
|
|
|
cf7baf5 |
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
|
|
|
cf7baf5 |
---
|
|
|
cf7baf5 |
tools/libxc/xc_physdev.c | 2 +-
|
|
|
cf7baf5 |
tools/python/xen/xend/server/pciif.py | 2 +-
|
|
|
cf7baf5 |
2 files changed, 2 insertions(+), 2 deletions(-)
|
|
|
cf7baf5 |
|
|
|
cf7baf5 |
diff --git a/tools/libxc/xc_physdev.c b/tools/libxc/xc_physdev.c
|
|
|
cf7baf5 |
index bdbcba7..cf02d85 100644
|
|
|
cf7baf5 |
--- a/tools/libxc/xc_physdev.c
|
|
|
cf7baf5 |
+++ b/tools/libxc/xc_physdev.c
|
|
|
cf7baf5 |
@@ -49,7 +49,7 @@ int xc_physdev_map_pirq(xc_interface *xch,
|
|
|
cf7baf5 |
map.domid = domid;
|
|
|
cf7baf5 |
map.type = MAP_PIRQ_TYPE_GSI;
|
|
|
cf7baf5 |
map.index = index;
|
|
|
cf7baf5 |
- map.pirq = *pirq;
|
|
|
cf7baf5 |
+ map.pirq = *pirq < 0 ? index : *pirq;
|
|
|
cf7baf5 |
|
|
|
cf7baf5 |
rc = do_physdev_op(xch, PHYSDEVOP_map_pirq, &map, sizeof(map));
|
|
|
cf7baf5 |
|
|
|
cf7baf5 |
diff --git a/tools/python/xen/xend/server/pciif.py b/tools/python/xen/xend/server/pciif.py
|
|
|
cf7baf5 |
index 43d0c80..27c1b75 100644
|
|
|
cf7baf5 |
--- a/tools/python/xen/xend/server/pciif.py
|
|
|
cf7baf5 |
+++ b/tools/python/xen/xend/server/pciif.py
|
|
|
cf7baf5 |
@@ -340,7 +340,7 @@ class PciController(DevController):
|
|
|
cf7baf5 |
raise VmError(('pci: failed to configure I/O memory on device '+
|
|
|
cf7baf5 |
'%s - errno=%d')%(dev.name,rc))
|
|
|
cf7baf5 |
|
|
|
cf7baf5 |
- if not self.vm.info.is_hvm() and dev.irq:
|
|
|
cf7baf5 |
+ if dev.irq > 0:
|
|
|
cf7baf5 |
rc = xc.physdev_map_pirq(domid = fe_domid,
|
|
|
cf7baf5 |
index = dev.irq,
|
|
|
cf7baf5 |
pirq = dev.irq)
|
|
|
cf7baf5 |
--
|
|
|
cf7baf5 |
1.7.2.5
|
|
|
cf7baf5 |
|