[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 45/49] ppc/xive: Force the Physical CAM line value to
From: |
David Gibson |
Subject: |
[Qemu-devel] [PULL 45/49] ppc/xive: Force the Physical CAM line value to group mode |
Date: |
Tue, 2 Jul 2019 16:08:53 +1000 |
From: Cédric Le Goater <address@hidden>
When an interrupt needs to be delivered, the XIVE interrupt controller
presenter scans the CAM lines of the thread interrupt contexts of the
HW threads of the chip to find a matching vCPU. The interrupt context
is composed of 4 different sets of registers: Physical, HV, OS and
User.
The encoding of the Physical CAM line depends on the mode in which the
interrupt controller is operating: CAM mode or block group mode.
Block group mode being the default configuration today on POWER9 and
the only one available on the next POWER10 generation, enforce this
encoding in the Physical CAM line :
chip << 19 | 0000000 0 0001 thread (7Bit)
It fits the overall encoding of the NVT ids and simplifies the matching
algorithm in the presenter.
Fixes: d514c48d41fb ("ppc/xive: hardwire the Physical CAM line of the thread
context")
Signed-off-by: Cédric Le Goater <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/intc/xive.c | 21 +++++----------------
1 file changed, 5 insertions(+), 16 deletions(-)
diff --git a/hw/intc/xive.c b/hw/intc/xive.c
index 6250c0414d..3b1f9520ae 100644
--- a/hw/intc/xive.c
+++ b/hw/intc/xive.c
@@ -1229,27 +1229,16 @@ XiveTCTX *xive_router_get_tctx(XiveRouter *xrtr,
CPUState *cs)
}
/*
- * By default on P9, the HW CAM line (23bits) is hardwired to :
+ * Encode the HW CAM line in the block group mode format :
*
- * 0x000||0b1||4Bit chip number||7Bit Thread number.
- *
- * When the block grouping is enabled, the CAM line is changed to :
- *
- * 4Bit chip number||0x001||7Bit Thread number.
+ * chip << 19 | 0000000 0 0001 thread (7Bit)
*/
-static uint32_t hw_cam_line(uint8_t chip_id, uint8_t tid)
-{
- return 1 << 11 | (chip_id & 0xf) << 7 | (tid & 0x7f);
-}
-
-static bool xive_presenter_tctx_match_hw(XiveTCTX *tctx,
- uint8_t nvt_blk, uint32_t nvt_idx)
+static uint32_t xive_tctx_hw_cam_line(XiveTCTX *tctx)
{
CPUPPCState *env = &POWERPC_CPU(tctx->cs)->env;
uint32_t pir = env->spr_cb[SPR_PIR].default_value;
- return hw_cam_line((pir >> 8) & 0xf, pir & 0x7f) ==
- hw_cam_line(nvt_blk, nvt_idx);
+ return xive_nvt_cam_line((pir >> 8) & 0xf, 1 << 7 | (pir & 0x7f));
}
/*
@@ -1285,7 +1274,7 @@ static int xive_presenter_tctx_match(XiveTCTX *tctx,
uint8_t format,
/* PHYS ring */
if ((be32_to_cpu(qw3w2) & TM_QW3W2_VT) &&
- xive_presenter_tctx_match_hw(tctx, nvt_blk, nvt_idx)) {
+ cam == xive_tctx_hw_cam_line(tctx)) {
return TM_QW3_HV_PHYS;
}
--
2.21.0
- [Qemu-devel] [PULL 23/49] xics/kvm: Skip rollback when KVM XICS is absent, (continued)
- [Qemu-devel] [PULL 23/49] xics/kvm: Skip rollback when KVM XICS is absent, David Gibson, 2019/07/02
- [Qemu-devel] [PULL 27/49] ppc: Introduce kvmppc_set_reg_tb_offset() helper, David Gibson, 2019/07/02
- [Qemu-devel] [PULL 19/49] hw/ppc/prep: Drop useless CONFIG_KVM ifdefery, David Gibson, 2019/07/02
- [Qemu-devel] [PULL 21/49] xics/spapr: Drop unused function declaration, David Gibson, 2019/07/02
- [Qemu-devel] [PULL 34/49] target/ppc: introduce GEN_VSX_HELPER_X2_AB macro to fpu_helper.c, David Gibson, 2019/07/02
- [Qemu-devel] [PULL 24/49] xics/kvm: Always use local_err in xics_kvm_init(), David Gibson, 2019/07/02
- [Qemu-devel] [PULL 31/49] target/ppc: introduce GEN_VSX_HELPER_X3 macro to fpu_helper.c, David Gibson, 2019/07/02
- [Qemu-devel] [PULL 41/49] target/ppc: improve VSX_FMADD with new GEN_VSX_HELPER_VSX_MADD macro, David Gibson, 2019/07/02
- [Qemu-devel] [PULL 44/49] spapr/xive: simplify spapr_irq_init_device() to remove the emulated init, David Gibson, 2019/07/02
- [Qemu-devel] [PULL 37/49] target/ppc: introduce GEN_VSX_HELPER_R2 macro to fpu_helper.c, David Gibson, 2019/07/02
- [Qemu-devel] [PULL 45/49] ppc/xive: Force the Physical CAM line value to group mode,
David Gibson <=
- [Qemu-devel] [PULL 35/49] target/ppc: introduce GEN_VSX_HELPER_X1 macro to fpu_helper.c, David Gibson, 2019/07/02
- [Qemu-devel] [PULL 36/49] target/ppc: introduce GEN_VSX_HELPER_R3 macro to fpu_helper.c, David Gibson, 2019/07/02
- [Qemu-devel] [PULL 33/49] target/ppc: introduce GEN_VSX_HELPER_X2 macro to fpu_helper.c, David Gibson, 2019/07/02
- [Qemu-devel] [PULL 39/49] target/ppc: decode target register in VSX_VECTOR_LOAD_STORE_LENGTH at translation time, David Gibson, 2019/07/02
- [Qemu-devel] [PULL 32/49] target/ppc: introduce separate generator and helper for xscvqpdp, David Gibson, 2019/07/02
- [Qemu-devel] [PULL 48/49] ppc/xive: Fix TM_PULL_POOL_CTX special operation, David Gibson, 2019/07/02
- [Qemu-devel] [PULL 40/49] target/ppc: decode target register in VSX_EXTRACT_INSERT at translation time, David Gibson, 2019/07/02
- [Qemu-devel] [PULL 30/49] target/ppc: introduce separate VSX_CMP macro for xvcmp* instructions, David Gibson, 2019/07/02
- [Qemu-devel] [PULL 46/49] ppc/xive: Make the PIPR register readonly, David Gibson, 2019/07/02
- [Qemu-devel] [PULL 47/49] ppc/pnv: Rework cache watch model of PnvXIVE, David Gibson, 2019/07/02