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>

+38
+38
drivers/xen/events.c
··· 1293 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 1332 static void restore_cpu_virqs(unsigned int cpu) 1297 1333 { 1298 1334 struct evtchn_bind_virq bind_virq; ··· 1472 1436 1473 1437 unmask_evtchn(evtchn); 1474 1438 } 1439 + 1440 + restore_cpu_pirqs(); 1475 1441 } 1476 1442 1477 1443 static struct irq_chip xen_dynamic_chip __read_mostly = {