mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
spapr: add a 'reset' method to the sPAPR IRQ backend
For the time being, the XIVE reset handler updates the OS CAM line of the vCPU as it is done under a real hypervisor when a vCPU is scheduled to run on a HW thread. This will let the XIVE presenter engine find a match among the NVTs dispatched on the HW threads. This handler will become even more useful when we introduce the machine supporting both interrupt modes, XIVE and XICS. In this machine, the interrupt mode is chosen by the CAS negotiation process and activated after a reset. Signed-off-by: Cédric Le Goater <clg@kaod.org> [dwg: Fix style nits] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
1c53b06c03
commit
b2e2247716
5 changed files with 56 additions and 1 deletions
|
@ -305,7 +305,14 @@ static void spapr_irq_print_info_xive(sPAPRMachineState *spapr,
|
|||
static Object *spapr_irq_cpu_intc_create_xive(sPAPRMachineState *spapr,
|
||||
Object *cpu, Error **errp)
|
||||
{
|
||||
return xive_tctx_create(cpu, XIVE_ROUTER(spapr->xive), errp);
|
||||
Object *obj = xive_tctx_create(cpu, XIVE_ROUTER(spapr->xive), errp);
|
||||
|
||||
/*
|
||||
* (TCG) Early setting the OS CAM line for hotplugged CPUs as they
|
||||
* don't benificiate from the reset of the XIVE IRQ backend
|
||||
*/
|
||||
spapr_xive_set_tctx_os_cam(XIVE_TCTX(obj));
|
||||
return obj;
|
||||
}
|
||||
|
||||
static int spapr_irq_post_load_xive(sPAPRMachineState *spapr, int version_id)
|
||||
|
@ -313,6 +320,18 @@ static int spapr_irq_post_load_xive(sPAPRMachineState *spapr, int version_id)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void spapr_irq_reset_xive(sPAPRMachineState *spapr, Error **errp)
|
||||
{
|
||||
CPUState *cs;
|
||||
|
||||
CPU_FOREACH(cs) {
|
||||
PowerPCCPU *cpu = POWERPC_CPU(cs);
|
||||
|
||||
/* (TCG) Set the OS CAM line of the thread interrupt context. */
|
||||
spapr_xive_set_tctx_os_cam(XIVE_TCTX(cpu->intc));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* XIVE uses the full IRQ number space. Set it to 8K to be compatible
|
||||
* with XICS.
|
||||
|
@ -333,6 +352,7 @@ sPAPRIrq spapr_irq_xive = {
|
|||
.dt_populate = spapr_dt_xive,
|
||||
.cpu_intc_create = spapr_irq_cpu_intc_create_xive,
|
||||
.post_load = spapr_irq_post_load_xive,
|
||||
.reset = spapr_irq_reset_xive,
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -378,6 +398,15 @@ int spapr_irq_post_load(sPAPRMachineState *spapr, int version_id)
|
|||
return smc->irq->post_load(spapr, version_id);
|
||||
}
|
||||
|
||||
void spapr_irq_reset(sPAPRMachineState *spapr, Error **errp)
|
||||
{
|
||||
sPAPRMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
|
||||
|
||||
if (smc->irq->reset) {
|
||||
smc->irq->reset(spapr, errp);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* XICS legacy routines - to deprecate one day
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue