diff options
author | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2010-12-01 09:51:44 -0500 |
---|---|---|
committer | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2010-12-02 09:40:50 -0500 |
commit | 9a069c33c53c2e72ec1b76106be73df044af0195 (patch) | |
tree | 765e44e4425da42f988e1fcf07e9b85cce708e40 /drivers/xen | |
parent | 6411fe69b8c4fd7811339c88c1843d562099fa2b (diff) |
xen: fix save/restore for PV on HVM guests with pirq remapping
Re-map and re-bind all the pirqs at resume time.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Diffstat (limited to 'drivers/xen')
-rw-r--r-- | drivers/xen/events.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/xen/events.c b/drivers/xen/events.c index f78945ce8aeb..f34288a5400c 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c | |||
@@ -1293,6 +1293,42 @@ static int retrigger_dynirq(unsigned int irq) | |||
1293 | return ret; | 1293 | return ret; |
1294 | } | 1294 | } |
1295 | 1295 | ||
1296 | static void restore_cpu_pirqs(void) | ||
1297 | { | ||
1298 | int pirq, rc, irq, gsi; | ||
1299 | struct physdev_map_pirq map_irq; | ||
1300 | |||
1301 | for (pirq = 0; pirq < nr_irqs; pirq++) { | ||
1302 | irq = pirq_to_irq[pirq]; | ||
1303 | if (irq == -1) | ||
1304 | continue; | ||
1305 | |||
1306 | /* save/restore of PT devices doesn't work, so at this point the | ||
1307 | * only devices present are GSI based emulated devices */ | ||
1308 | gsi = gsi_from_irq(irq); | ||
1309 | if (!gsi) | ||
1310 | continue; | ||
1311 | |||
1312 | map_irq.domid = DOMID_SELF; | ||
1313 | map_irq.type = MAP_PIRQ_TYPE_GSI; | ||
1314 | map_irq.index = gsi; | ||
1315 | map_irq.pirq = pirq; | ||
1316 | |||
1317 | rc = HYPERVISOR_physdev_op(PHYSDEVOP_map_pirq, &map_irq); | ||
1318 | if (rc) { | ||
1319 | printk(KERN_WARNING "xen map irq failed gsi=%d irq=%d pirq=%d rc=%d\n", | ||
1320 | gsi, irq, pirq, rc); | ||
1321 | irq_info[irq] = mk_unbound_info(); | ||
1322 | pirq_to_irq[pirq] = -1; | ||
1323 | continue; | ||
1324 | } | ||
1325 | |||
1326 | printk(KERN_DEBUG "xen: --> irq=%d, pirq=%d\n", irq, map_irq.pirq); | ||
1327 | |||
1328 | startup_pirq(irq); | ||
1329 | } | ||
1330 | } | ||
1331 | |||
1296 | static void restore_cpu_virqs(unsigned int cpu) | 1332 | static void restore_cpu_virqs(unsigned int cpu) |
1297 | { | 1333 | { |
1298 | struct evtchn_bind_virq bind_virq; | 1334 | struct evtchn_bind_virq bind_virq; |
@@ -1436,6 +1472,8 @@ void xen_irq_resume(void) | |||
1436 | 1472 | ||
1437 | unmask_evtchn(evtchn); | 1473 | unmask_evtchn(evtchn); |
1438 | } | 1474 | } |
1475 | |||
1476 | restore_cpu_pirqs(); | ||
1439 | } | 1477 | } |
1440 | 1478 | ||
1441 | static struct irq_chip xen_dynamic_chip __read_mostly = { | 1479 | static struct irq_chip xen_dynamic_chip __read_mostly = { |