From patchwork Wed Nov 4 22:20:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 1394527 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CRLht2lDxz9sVM for ; Thu, 5 Nov 2020 09:21:18 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kaod.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4CRLht0bmHzDqf3 for ; Thu, 5 Nov 2020 09:21:18 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=softfail (domain owner discourages use of this host) smtp.mailfrom=kaod.org (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=clg@kaod.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=kaod.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4CRLhk3MNdzDqCw for ; Thu, 5 Nov 2020 09:21:09 +1100 (AEDT) Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0A4M5nfd156793; Wed, 4 Nov 2020 17:21:04 -0500 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 34m1yhd54c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Nov 2020 17:21:04 -0500 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0A4MJ56v018806; Wed, 4 Nov 2020 22:21:02 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma04ams.nl.ibm.com with ESMTP id 34h01uckaq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Nov 2020 22:21:02 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0A4ML0QF30998806 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 4 Nov 2020 22:21:00 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 15408A4040; Wed, 4 Nov 2020 22:21:00 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E1CCBA404D; Wed, 4 Nov 2020 22:20:59 +0000 (GMT) Received: from smtp.tlslab.ibm.com (unknown [9.101.4.1]) by d06av23.portsmouth.uk.ibm.com (Postfix) with SMTP; Wed, 4 Nov 2020 22:20:59 +0000 (GMT) Received: from yukon.ibmuc.com (sig-9-145-76-206.uk.ibm.com [9.145.76.206]) by smtp.tlslab.ibm.com (Postfix) with ESMTP id 64D55220210; Wed, 4 Nov 2020 23:20:59 +0100 (CET) From: =?utf-8?q?C=C3=A9dric_Le_Goater?= To: skiboot@lists.ozlabs.org Date: Wed, 4 Nov 2020 23:20:54 +0100 Message-Id: <20201104222057.590816-2-clg@kaod.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201104222057.590816-1-clg@kaod.org> References: <20201104222057.590816-1-clg@kaod.org> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312, 18.0.737 definitions=2020-11-04_15:2020-11-04, 2020-11-04 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxlogscore=579 suspectscore=1 adultscore=0 priorityscore=1501 impostorscore=0 mlxscore=0 spamscore=0 lowpriorityscore=0 phishscore=0 malwarescore=0 clxscore=1034 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011040156 Subject: [Skiboot] [PATCH 1/4] xive/p9: Use local_alloc() to allocate the XIVE bitmaps X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?C=C3=A9dric_Le_Goater?= Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" These bitmaps are big (128K). On systems with multiple sockets, we will run out of heap. Signed-off-by: Cédric Le Goater --- hw/xive.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hw/xive.c b/hw/xive.c index c1786f288c90..34e211c3bf1a 100644 --- a/hw/xive.c +++ b/hw/xive.c @@ -2636,15 +2636,19 @@ static struct xive *init_one_xive(struct dt_node *np) x->int_ipi_top = XIVE_INT_FIRST; /* Allocate a few bitmaps */ - x->eq_map = zalloc(BITMAP_BYTES(XIVE_EQ_COUNT >> 3)); + x->eq_map = local_alloc(x->chip_id, BITMAP_BYTES(XIVE_EQ_COUNT >> 3), PAGE_SIZE); assert(x->eq_map); + memset(x->eq_map, 0, BITMAP_BYTES(XIVE_EQ_COUNT >> 3)); + /* Make sure we don't hand out 0 */ bitmap_set_bit(*x->eq_map, 0); - x->int_enabled_map = zalloc(BITMAP_BYTES(XIVE_INT_COUNT)); + x->int_enabled_map = local_alloc(x->chip_id, BITMAP_BYTES(XIVE_INT_COUNT), PAGE_SIZE); assert(x->int_enabled_map); - x->ipi_alloc_map = zalloc(BITMAP_BYTES(XIVE_INT_COUNT)); + memset(x->int_enabled_map, 0, BITMAP_BYTES(XIVE_INT_COUNT)); + x->ipi_alloc_map = local_alloc(x->chip_id, BITMAP_BYTES(XIVE_INT_COUNT), PAGE_SIZE); assert(x->ipi_alloc_map); + memset(x->ipi_alloc_map, 0, BITMAP_BYTES(XIVE_INT_COUNT)); xive_dbg(x, "Handling interrupts [%08x..%08x]\n", x->int_base, x->int_max - 1); From patchwork Wed Nov 4 22:20:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 1394530 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CRLjy2zkhz9sVD for ; Thu, 5 Nov 2020 09:22:14 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kaod.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4CRLjy12YnzDqhC for ; Thu, 5 Nov 2020 09:22:14 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=softfail (domain owner discourages use of this host) smtp.mailfrom=kaod.org (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=clg@kaod.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=kaod.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4CRLhp5bX5zDqJM for ; Thu, 5 Nov 2020 09:21:14 +1100 (AEDT) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0A4M2m2w102545; Wed, 4 Nov 2020 17:21:05 -0500 Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com with ESMTP id 34m47x152g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Nov 2020 17:21:05 -0500 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0A4MKgRA010627; Wed, 4 Nov 2020 22:21:03 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma01fra.de.ibm.com with ESMTP id 34jbytshxj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Nov 2020 22:21:02 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0A4ML0FH65143056 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 4 Nov 2020 22:21:00 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 864EA11C04A; Wed, 4 Nov 2020 22:21:00 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 680EF11C04C; Wed, 4 Nov 2020 22:21:00 +0000 (GMT) Received: from smtp.tlslab.ibm.com (unknown [9.101.4.1]) by d06av25.portsmouth.uk.ibm.com (Postfix) with SMTP; Wed, 4 Nov 2020 22:21:00 +0000 (GMT) Received: from yukon.ibmuc.com (sig-9-145-76-206.uk.ibm.com [9.145.76.206]) by smtp.tlslab.ibm.com (Postfix) with ESMTP id D57DA2201D0; Wed, 4 Nov 2020 23:20:59 +0100 (CET) From: =?utf-8?q?C=C3=A9dric_Le_Goater?= To: skiboot@lists.ozlabs.org Date: Wed, 4 Nov 2020 23:20:55 +0100 Message-Id: <20201104222057.590816-3-clg@kaod.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201104222057.590816-1-clg@kaod.org> References: <20201104222057.590816-1-clg@kaod.org> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312, 18.0.737 definitions=2020-11-04_15:2020-11-04, 2020-11-04 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 lowpriorityscore=0 malwarescore=0 mlxlogscore=769 spamscore=0 mlxscore=0 suspectscore=1 phishscore=0 priorityscore=1501 impostorscore=0 bulkscore=0 clxscore=1034 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011040156 Subject: [Skiboot] [PATCH 2/4] psi/p9: mask all sources at init X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?C=C3=A9dric_Le_Goater?= Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Signed-off-by: Cédric Le Goater --- hw/psi.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hw/psi.c b/hw/psi.c index 8a0704729015..545a81643e11 100644 --- a/hw/psi.c +++ b/hw/psi.c @@ -530,6 +530,17 @@ static const char *psi_p9_irq_names[P9_PSI_NUM_IRQS] = { "psu" }; +static void psi_p9_mask_all(struct psi *psi) +{ + struct irq_source *is; + int isn; + + /* Mask all sources */ + is = irq_find_source(psi->interrupt); + for (isn = is->start; isn < is->end; isn++) + xive_source_mask(is, isn); +} + static void psi_p9_mask_unhandled_irq(struct irq_source *is, uint32_t isn) { struct psi *psi = is->data; @@ -709,6 +720,8 @@ static void psi_init_p9_interrupts(struct psi *psi) 12, psi->esb_mmio, XIVE_SRC_LSI, psi, &psi_p9_irq_ops); + psi_p9_mask_all(psi); + /* Setup interrupt offset */ val = xive_get_notify_base(psi->interrupt); val <<= 32; From patchwork Wed Nov 4 22:20:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 1394528 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CRLjM0Ypqz9sTK for ; Thu, 5 Nov 2020 09:21:43 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kaod.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4CRLjL5FXczDqgV for ; Thu, 5 Nov 2020 09:21:42 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=softfail (domain owner discourages use of this host) smtp.mailfrom=kaod.org (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=clg@kaod.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=kaod.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4CRLhk3PZdzDqJM for ; Thu, 5 Nov 2020 09:21:09 +1100 (AEDT) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0A4M2nfb102799; Wed, 4 Nov 2020 17:21:05 -0500 Received: from ppma05fra.de.ibm.com (6c.4a.5195.ip4.static.sl-reverse.com [149.81.74.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 34m47x152k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Nov 2020 17:21:05 -0500 Received: from pps.filterd (ppma05fra.de.ibm.com [127.0.0.1]) by ppma05fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0A4MJUjt031283; Wed, 4 Nov 2020 22:21:03 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma05fra.de.ibm.com with ESMTP id 34h01qtewh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Nov 2020 22:21:03 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0A4ML1ws62390674 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 4 Nov 2020 22:21:01 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0AA0AAE055; Wed, 4 Nov 2020 22:21:01 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D7C40AE057; Wed, 4 Nov 2020 22:21:00 +0000 (GMT) Received: from smtp.tlslab.ibm.com (unknown [9.101.4.1]) by d06av26.portsmouth.uk.ibm.com (Postfix) with SMTP; Wed, 4 Nov 2020 22:21:00 +0000 (GMT) Received: from yukon.ibmuc.com (sig-9-145-76-206.uk.ibm.com [9.145.76.206]) by smtp.tlslab.ibm.com (Postfix) with ESMTP id 5C47C220210; Wed, 4 Nov 2020 23:21:00 +0100 (CET) From: =?utf-8?q?C=C3=A9dric_Le_Goater?= To: skiboot@lists.ozlabs.org Date: Wed, 4 Nov 2020 23:20:56 +0100 Message-Id: <20201104222057.590816-4-clg@kaod.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201104222057.590816-1-clg@kaod.org> References: <20201104222057.590816-1-clg@kaod.org> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312, 18.0.737 definitions=2020-11-04_15:2020-11-04, 2020-11-04 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 lowpriorityscore=0 malwarescore=0 mlxlogscore=999 spamscore=0 mlxscore=0 suspectscore=1 phishscore=0 priorityscore=1501 impostorscore=0 bulkscore=0 clxscore=1034 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011040156 Subject: [Skiboot] [PATCH 3/4] xive/p9: Introduce XIVE_ESB_PAGE_SIZE X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?C=C3=A9dric_Le_Goater?= Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Rename XIVE_ESB_SIZE to XIVE_ESB_PAGE_SIZE in the xive/p9 driver to be consistent with the xive2/p10 driver. Signed-off-by: Cédric Le Goater --- hw/xive.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/xive.c b/hw/xive.c index 34e211c3bf1a..af502fbfe79e 100644 --- a/hw/xive.c +++ b/hw/xive.c @@ -157,7 +157,7 @@ /* Use 64K for everything by default */ #define XIVE_ESB_SHIFT (16 + 1) /* trigger + mgmt pages */ -#define XIVE_ESB_SIZE (1ul << XIVE_ESB_SHIFT) /* 2 pages */ +#define XIVE_ESB_PAGE_SIZE (1ul << XIVE_ESB_SHIFT) /* 2 pages */ /* Max number of EQs. We allocate an indirect table big enough so * that when fully populated we can have that many EQs. @@ -1102,7 +1102,7 @@ static void xive_scrub_workaround_eq(struct xive *x, uint32_t block __unused, ui /* EQ variant of the workaround described in __xive_cache_scrub(), * a simple non-side effect load from ESn will do */ - mmio = x->eq_mmio + idx * XIVE_ESB_SIZE; + mmio = x->eq_mmio + idx * XIVE_ESB_PAGE_SIZE; /* Ensure the above has returned before we do anything else * the XIVE store queue is completely empty @@ -1944,7 +1944,7 @@ void *xive_get_trigger_port(uint32_t girq) girq >= x->int_ipi_top) return NULL; - return x->esb_mmio + idx * XIVE_ESB_SIZE; + return x->esb_mmio + idx * XIVE_ESB_PAGE_SIZE; } } @@ -2719,7 +2719,7 @@ static void xive_ipi_init(struct xive *x, struct cpu_thread *cpu) static void xive_ipi_eoi(struct xive *x, uint32_t idx) { - uint8_t *mm = x->esb_mmio + idx * XIVE_ESB_SIZE; + uint8_t *mm = x->esb_mmio + idx * XIVE_ESB_PAGE_SIZE; uint8_t eoi_val; /* For EOI, we use the special MMIO that does a clear of both @@ -2736,7 +2736,7 @@ static void xive_ipi_eoi(struct xive *x, uint32_t idx) static void xive_ipi_trigger(struct xive *x, uint32_t idx) { - uint8_t *mm = x->esb_mmio + idx * XIVE_ESB_SIZE; + uint8_t *mm = x->esb_mmio + idx * XIVE_ESB_PAGE_SIZE; xive_vdbg(x, "Trigger IPI 0x%x\n", idx); @@ -2965,7 +2965,7 @@ static void xive_init_cpu_emulation(struct xive_cpu_state *xs, xs->eqgen = 0; x = xive_from_vc_blk(xs->eq_blk); assert(x); - xs->eqmmio = x->eq_mmio + (xs->eq_idx + XIVE_EMULATION_PRIO) * XIVE_ESB_SIZE; + xs->eqmmio = x->eq_mmio + (xs->eq_idx + XIVE_EMULATION_PRIO) * XIVE_ESB_PAGE_SIZE; } static void xive_init_cpu_exploitation(struct xive_cpu_state *xs) @@ -3837,7 +3837,7 @@ static int64_t opal_xive_get_queue_info(uint64_t vp, uint32_t prio, } if (out_qeoi_page) { *out_qeoi_page = - cpu_to_be64((uint64_t)x->eq_mmio + idx * XIVE_ESB_SIZE); + cpu_to_be64((uint64_t)x->eq_mmio + idx * XIVE_ESB_PAGE_SIZE); } if (out_qflags) { *out_qflags = 0; @@ -5028,7 +5028,7 @@ static int64_t __opal_xive_dump_emu(struct xive_cpu_state *xs, uint32_t pir) xs->eqbuf[(xs->eqptr + 2) & xs->eqmsk], xs->eqbuf[(xs->eqptr + 3) & xs->eqmsk]); - mm = xs->xive->esb_mmio + GIRQ_TO_IDX(xs->ipi_irq) * XIVE_ESB_SIZE; + mm = xs->xive->esb_mmio + GIRQ_TO_IDX(xs->ipi_irq) * XIVE_ESB_PAGE_SIZE; pq = in_8(mm + 0x10800); if (xive_get_irq_targetting(xs->ipi_irq, &ipi_target, NULL, NULL)) prlog(PR_INFO, "CPU[%04x]: IPI #%08x PQ=%x target=%08x\n", From patchwork Wed Nov 4 22:20:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 1394531 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CRLkF2GD0z9sTK for ; Thu, 5 Nov 2020 09:22:29 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kaod.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4CRLkD4HlyzDqKh for ; Thu, 5 Nov 2020 09:22:28 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=softfail (domain owner discourages use of this host) smtp.mailfrom=kaod.org (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=clg@kaod.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=kaod.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4CRLhr6kqlzDqCw for ; Thu, 5 Nov 2020 09:21:16 +1100 (AEDT) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0A4M2eMn184437; Wed, 4 Nov 2020 17:21:06 -0500 Received: from ppma05fra.de.ibm.com (6c.4a.5195.ip4.static.sl-reverse.com [149.81.74.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 34m34xb3r3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Nov 2020 17:21:06 -0500 Received: from pps.filterd (ppma05fra.de.ibm.com [127.0.0.1]) by ppma05fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0A4MHXVF030539; Wed, 4 Nov 2020 22:21:03 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma05fra.de.ibm.com with ESMTP id 34h01qtewj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 04 Nov 2020 22:21:03 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0A4ML1UB56295864 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 4 Nov 2020 22:21:01 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7E8EE11C058; Wed, 4 Nov 2020 22:21:01 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5691C11C04A; Wed, 4 Nov 2020 22:21:01 +0000 (GMT) Received: from smtp.tlslab.ibm.com (unknown [9.101.4.1]) by d06av25.portsmouth.uk.ibm.com (Postfix) with SMTP; Wed, 4 Nov 2020 22:21:01 +0000 (GMT) Received: from yukon.ibmuc.com (sig-9-145-76-206.uk.ibm.com [9.145.76.206]) by smtp.tlslab.ibm.com (Postfix) with ESMTP id CC95C2201D0; Wed, 4 Nov 2020 23:21:00 +0100 (CET) From: =?utf-8?q?C=C3=A9dric_Le_Goater?= To: skiboot@lists.ozlabs.org Date: Wed, 4 Nov 2020 23:20:57 +0100 Message-Id: <20201104222057.590816-5-clg@kaod.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201104222057.590816-1-clg@kaod.org> References: <20201104222057.590816-1-clg@kaod.org> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312, 18.0.737 definitions=2020-11-04_15:2020-11-04, 2020-11-04 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=1 impostorscore=0 adultscore=0 malwarescore=0 mlxscore=0 phishscore=0 bulkscore=0 mlxlogscore=999 lowpriorityscore=0 clxscore=1034 priorityscore=1501 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011040154 Subject: [Skiboot] [PATCH 4/4] xive/p9: Add a retry counter when updating the cache watch X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?C=C3=A9dric_Le_Goater?= Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Signed-off-by: Cédric Le Goater --- hw/xive.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hw/xive.c b/hw/xive.c index af502fbfe79e..7d4e029f19cb 100644 --- a/hw/xive.c +++ b/hw/xive.c @@ -1222,6 +1222,8 @@ static int64_t xive_eqc_scrub(struct xive *x, uint64_t block, uint64_t idx) return __xive_cache_scrub(x, xive_cache_eqc, block, idx, false, false); } +#define XIVE_CACHE_WATCH_MAX_RETRIES 10 + static int64_t __xive_cache_watch(struct xive *x, enum xive_cache_type ctype, uint64_t block, uint64_t idx, uint32_t start_dword, uint32_t dword_count, @@ -1231,6 +1233,7 @@ static int64_t __xive_cache_watch(struct xive *x, enum xive_cache_type ctype, uint64_t sreg, sregx, dreg0, dreg0x; uint64_t dval0, sval, status; int64_t i; + int retries = 0; #ifdef XIVE_CHECK_LOCKS assert(lock_held_by_me(&x->lock)); @@ -1303,7 +1306,12 @@ static int64_t __xive_cache_watch(struct xive *x, enum xive_cache_type ctype, if (!synchronous) return OPAL_BUSY; - /* XXX Add timeout ? */ + if (++retries == XIVE_CACHE_WATCH_MAX_RETRIES) { + xive_err(x, "Reached maximum retries %d when doing " + "a %s cache update\n", retries, + ctype == xive_cache_eqc ? "EQC" : "VPC"); + return OPAL_BUSY; + } } /* Perform a scrub with "want_invalidate" set to false to push the