pnv/xive: Deduce the PnvXive pointer from XiveTCTX::xptr

And use it instead of reaching out to the machine. This allows to get
rid of pnv_get_chip().

Signed-off-by: Greg Kurz <groug@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20200106145645.4539-11-clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
Greg Kurz 2020-01-06 15:56:43 +01:00 committed by David Gibson
parent 74e51a38f7
commit 806fed593d
3 changed files with 2 additions and 22 deletions

View file

@ -472,12 +472,8 @@ static uint8_t pnv_xive_get_block_id(XiveRouter *xrtr)
static PnvXive *pnv_xive_tm_get_xive(PowerPCCPU *cpu)
{
int pir = ppc_cpu_pir(cpu);
PnvChip *chip;
PnvXive *xive;
chip = pnv_get_chip(PNV9_PIR2CHIP(pir));
assert(chip);
xive = &PNV9_CHIP(chip)->xive;
XivePresenter *xptr = XIVE_TCTX(pnv_cpu_state(cpu)->intc)->xptr;
PnvXive *xive = PNV_XIVE(xptr);
if (!pnv_xive_is_cpu_enabled(xive, cpu)) {
xive_error(xive, "IC: CPU %x is not enabled", pir);