qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v2 15/17] ppc/pnv: Grab the XiveRouter object from X


From: Cédric Le Goater
Subject: [Qemu-devel] [PATCH v2 15/17] ppc/pnv: Grab the XiveRouter object from XiveTCTX in pnv_xive_get_tctx()
Date: Thu, 18 Jul 2019 13:54:18 +0200

It removes a useless call to pnv_xive_get_ic() which is making some
assumption on the chip_id format.

Signed-off-by: Cédric Le Goater <address@hidden>
---
 hw/intc/pnv_xive.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/hw/intc/pnv_xive.c b/hw/intc/pnv_xive.c
index a48f6750154e..403e8c8ca5b4 100644
--- a/hw/intc/pnv_xive.c
+++ b/hw/intc/pnv_xive.c
@@ -370,22 +370,13 @@ static XiveTCTX *pnv_xive_get_tctx(XiveRouter *xrtr, 
CPUState *cs)
 {
     PowerPCCPU *cpu = POWERPC_CPU(cs);
     XiveTCTX *tctx = XIVE_TCTX(pnv_cpu_state(cpu)->intc);
-    PnvXive *xive = NULL;
+    PnvXive *xive = PNV_XIVE(tctx->xrtr);
     CPUPPCState *env = &cpu->env;
     int pir = env->spr_cb[SPR_PIR].default_value;
 
     /*
      * Perform an extra check on the HW thread enablement.
-     *
-     * The TIMA is shared among the chips and to identify the chip
-     * from which the access is being done, we extract the chip id
-     * from the PIR.
      */
-    xive = pnv_xive_get_ic((pir >> 8) & 0xf);
-    if (!xive) {
-        return NULL;
-    }
-
     if (!(xive->regs[PC_THREAD_EN_REG0 >> 3] & PPC_BIT(pir & 0x3f))) {
         xive_error(PNV_XIVE(xrtr), "IC: CPU %x is not enabled", pir);
     }
-- 
2.21.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]