From ae1331300e0d128b22c2d31d9ea9288c646d043d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Date: Wed, 4 Aug 2021 12:51:19 +0530 Subject: xive/p10: Configure XIVE for fused cores MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Cédric Le Goater Signed-off-by: Vasant Hegde --- hw/xive2.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'hw/xive2.c') diff --git a/hw/xive2.c b/hw/xive2.c index 3d74b85..f221ac5 100644 --- a/hw/xive2.c +++ b/hw/xive2.c @@ -1593,6 +1593,19 @@ static bool xive_has_cap(struct xive *x, uint64_t cap) #define XIVE_CAN_STORE_EOI(x) xive_has_cap(x, CQ_XIVE_CAP_STORE_EOI) +static void xive_config_fused_core(struct xive *x) +{ + uint64_t val = xive_regr(x, TCTXT_CFG); + + if (this_cpu()->is_fused_core) { + val |= TCTXT_CFG_FUSE_CORE_EN; + xive_dbg(x, "configured for fused cores. " + "PC_TCTXT_CFG=%016llx\n", val); + } else + val &= ~TCTXT_CFG_FUSE_CORE_EN; + xive_regw(x, TCTXT_CFG, val); +} + static void xive_config_reduced_priorities_fixup(struct xive *x) { if (xive_cfg_vp_prio_shift(x) < CQ_XIVE_CFG_INT_PRIO_8 && @@ -1685,6 +1698,8 @@ static bool xive_config_init(struct xive *x) xive_dbg(x, "store EOI is %savailable\n", XIVE_CAN_STORE_EOI(x) ? "" : "not "); + xive_config_fused_core(x); + xive_config_reduced_priorities_fixup(x); return true; @@ -2980,7 +2995,7 @@ static void xive_init_cpu(struct cpu_thread *c) * of a pair is present we just do the setup for each of them, which * is harmless. */ - if (cpu_is_thread0(c)) + if (cpu_is_thread0(c) || cpu_is_core_chiplet_primary(c)) xive_configure_ex_special_bar(x, c); /* Initialize the state structure */ -- cgit v1.1