mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03: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
|
@ -179,6 +179,23 @@ static void spapr_xive_map_mmio(sPAPRXive *xive)
|
|||
sysbus_mmio_map(SYS_BUS_DEVICE(xive), 2, xive->tm_base);
|
||||
}
|
||||
|
||||
/*
|
||||
* When a Virtual Processor is scheduled to run on a HW thread, the
|
||||
* hypervisor pushes its identifier in the OS CAM line. Emulate the
|
||||
* same behavior under QEMU.
|
||||
*/
|
||||
void spapr_xive_set_tctx_os_cam(XiveTCTX *tctx)
|
||||
{
|
||||
uint8_t nvt_blk;
|
||||
uint32_t nvt_idx;
|
||||
uint32_t nvt_cam;
|
||||
|
||||
spapr_xive_cpu_to_nvt(POWERPC_CPU(tctx->cs), &nvt_blk, &nvt_idx);
|
||||
|
||||
nvt_cam = cpu_to_be32(TM_QW1W2_VO | xive_nvt_cam_line(nvt_blk, nvt_idx));
|
||||
memcpy(&tctx->regs[TM_QW1_OS + TM_WORD2], &nvt_cam, 4);
|
||||
}
|
||||
|
||||
static void spapr_xive_end_reset(XiveEND *end)
|
||||
{
|
||||
memset(end, 0, sizeof(*end));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue