mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
spapr: extend the sPAPR IRQ backend for XICS migration
Introduce a new sPAPR IRQ handler to handle resend after migration when the machine is using a KVM XICS interrupt controller model. Signed-off-by: Cédric Le Goater <clg@kaod.org> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
1a937ad7e7
commit
1c53b06c03
3 changed files with 34 additions and 8 deletions
|
@ -197,6 +197,18 @@ static Object *spapr_irq_cpu_intc_create_xics(sPAPRMachineState *spapr,
|
|||
return icp_create(cpu, spapr->icp_type, XICS_FABRIC(spapr), errp);
|
||||
}
|
||||
|
||||
static int spapr_irq_post_load_xics(sPAPRMachineState *spapr, int version_id)
|
||||
{
|
||||
if (!object_dynamic_cast(OBJECT(spapr->ics), TYPE_ICS_KVM)) {
|
||||
CPUState *cs;
|
||||
CPU_FOREACH(cs) {
|
||||
PowerPCCPU *cpu = POWERPC_CPU(cs);
|
||||
icp_resend(ICP(cpu->intc));
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define SPAPR_IRQ_XICS_NR_IRQS 0x1000
|
||||
#define SPAPR_IRQ_XICS_NR_MSIS \
|
||||
(XICS_IRQ_BASE + SPAPR_IRQ_XICS_NR_IRQS - SPAPR_IRQ_MSI)
|
||||
|
@ -212,6 +224,7 @@ sPAPRIrq spapr_irq_xics = {
|
|||
.print_info = spapr_irq_print_info_xics,
|
||||
.dt_populate = spapr_dt_xics,
|
||||
.cpu_intc_create = spapr_irq_cpu_intc_create_xics,
|
||||
.post_load = spapr_irq_post_load_xics,
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -295,6 +308,11 @@ static Object *spapr_irq_cpu_intc_create_xive(sPAPRMachineState *spapr,
|
|||
return xive_tctx_create(cpu, XIVE_ROUTER(spapr->xive), errp);
|
||||
}
|
||||
|
||||
static int spapr_irq_post_load_xive(sPAPRMachineState *spapr, int version_id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* XIVE uses the full IRQ number space. Set it to 8K to be compatible
|
||||
* with XICS.
|
||||
|
@ -314,6 +332,7 @@ sPAPRIrq spapr_irq_xive = {
|
|||
.print_info = spapr_irq_print_info_xive,
|
||||
.dt_populate = spapr_dt_xive,
|
||||
.cpu_intc_create = spapr_irq_cpu_intc_create_xive,
|
||||
.post_load = spapr_irq_post_load_xive,
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -352,6 +371,13 @@ qemu_irq spapr_qirq(sPAPRMachineState *spapr, int irq)
|
|||
return smc->irq->qirq(spapr, irq);
|
||||
}
|
||||
|
||||
int spapr_irq_post_load(sPAPRMachineState *spapr, int version_id)
|
||||
{
|
||||
sPAPRMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
|
||||
|
||||
return smc->irq->post_load(spapr, version_id);
|
||||
}
|
||||
|
||||
/*
|
||||
* XICS legacy routines - to deprecate one day
|
||||
*/
|
||||
|
@ -420,4 +446,5 @@ sPAPRIrq spapr_irq_xics_legacy = {
|
|||
.print_info = spapr_irq_print_info_xics,
|
||||
.dt_populate = spapr_dt_xics,
|
||||
.cpu_intc_create = spapr_irq_cpu_intc_create_xics,
|
||||
.post_load = spapr_irq_post_load_xics,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue