From 09a7e60c6411c7c390aa392672fbdbef5e5e2084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Date: Wed, 2 Mar 2022 06:51:39 +0100 Subject: pnv/xive2: Add support for 8bits thread id MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Daniel Henrique Barboza Signed-off-by: Cédric Le Goater --- hw/intc/pnv_xive2.c | 5 +++++ hw/intc/xive2.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'hw') diff --git a/hw/intc/pnv_xive2.c b/hw/intc/pnv_xive2.c index b51571c603..87303b4064 100644 --- a/hw/intc/pnv_xive2.c +++ b/hw/intc/pnv_xive2.c @@ -439,6 +439,11 @@ static uint32_t pnv_xive2_get_config(Xive2Router *xrtr) cfg |= XIVE2_VP_SAVE_RESTORE; } + if (GETFIELD(CQ_XIVE_CFG_HYP_HARD_RANGE, + xive->cq_regs[CQ_XIVE_CFG >> 3]) == CQ_XIVE_CFG_THREADID_8BITS) { + cfg |= XIVE2_THREADID_8BITS; + } + return cfg; } diff --git a/hw/intc/xive2.c b/hw/intc/xive2.c index fd9cfebd78..b6452f1478 100644 --- a/hw/intc/xive2.c +++ b/hw/intc/xive2.c @@ -459,7 +459,8 @@ static uint32_t xive2_tctx_hw_cam_line(XivePresenter *xptr, XiveTCTX *tctx) CPUPPCState *env = &POWERPC_CPU(tctx->cs)->env; uint32_t pir = env->spr_cb[SPR_PIR].default_value; uint8_t blk = xive2_router_get_block_id(xrtr); - uint8_t tid_shift = 7; + uint8_t tid_shift = + xive2_router_get_config(xrtr) & XIVE2_THREADID_8BITS ? 8 : 7; uint8_t tid_mask = (1 << tid_shift) - 1; return xive2_nvp_cam_line(blk, 1 << tid_shift | (pir & tid_mask)); -- cgit v1.2.3