From patchwork Wed Jun 14 16:51:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 9786967 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7151760325 for ; Wed, 14 Jun 2017 16:54:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 635D0285E6 for ; Wed, 14 Jun 2017 16:54:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 582712860B; Wed, 14 Jun 2017 16:54:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0958C285E6 for ; Wed, 14 Jun 2017 16:54:51 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLBWo-0006Jv-ES; Wed, 14 Jun 2017 16:52:22 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLBWm-0006JQ-OA for xen-devel@lists.xenproject.org; Wed, 14 Jun 2017 16:52:20 +0000 Received: from [85.158.137.68] by server-6.bemta-3.messagelabs.com id B6/31-19409-3C961495; Wed, 14 Jun 2017 16:52:19 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGLMWRWlGSWpSXmKPExsVysyfVTfdwpmO kQeNLMYvvWyYzOTB6HP5whSWAMYo1My8pvyKBNePSN/2COTwVZ1/+ZGlgPMbZxcjFISSwmVFi 2p+rjBDOckaJO5d+M3UxcnKwCehK7Lj5mhnEFhEIlXi64DszSBGzwHVGidM75rOBJIQF7CRWz tkDVsQioCpxfdE6RhCbV8BK4s2kw2A1EgJyEg3n74PVcApYS0zdPhloAQfQNiuJmyv0JzByL2 BkWMWoUZxaVJZapGtkrpdUlJmeUZKbmJmja2hgrJebWlycmJ6ak5hUrJecn7uJEejfegYGxh2 MLXv9DjFKcjApifJOFXSMFOJLyk+pzEgszogvKs1JLT7EKMPBoSTBezgDKCdYlJqeWpGWmQMM NJi0BAePkgjv1lSgNG9xQWJucWY6ROoUo6KUOO9ZkD4BkERGaR5cGyy4LzHKSgnzMjIwMAjxF KQW5WaWoMq/YhTnYFQS5i1LB5rCk5lXAjf9FdBiJqDFQRccQBaXJCKkpBoYZ+g/8dk2TbS1uW ttn5zsricF8SffHt1Y6nPc2y/VU/HCta17u58IHheSWZOomL/+QZtH7Zepktee9lz94N5RG/N zJYNlrRnz7nMN7QkNHQbOJltj647uUPzxi61RWD+78ZTSFom+xn0zXnS5ezkv+1KaMX1OTItN WEdFa9DhvJgPjeEV++crsRRnJBpqMRcVJwIAoRshZ2kCAAA= X-Env-Sender: andre.przywara@arm.com X-Msg-Ref: server-7.tower-31.messagelabs.com!1497459138!98107514!1 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.19; banners=-,-,- X-VirusChecked: Checked Received: (qmail 1015 invoked from network); 14 Jun 2017 16:52:19 -0000 Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-7.tower-31.messagelabs.com with SMTP; 14 Jun 2017 16:52:19 -0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 97CA415B2; Wed, 14 Jun 2017 09:52:18 -0700 (PDT) Received: from e104803-lin.lan (unknown [10.1.207.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 471ED3F3E1; Wed, 14 Jun 2017 09:52:17 -0700 (PDT) From: Andre Przywara To: Julien Grall , Stefano Stabellini Date: Wed, 14 Jun 2017 17:51:52 +0100 Message-Id: <20170614165223.7543-4-andre.przywara@arm.com> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170614165223.7543-1-andre.przywara@arm.com> References: <20170614165223.7543-1-andre.przywara@arm.com> Cc: xen-devel@lists.xenproject.org, Vijaya Kumar K , Vijay Kilari , Shanker Donthineni , Manish Jaggi Subject: [Xen-devel] [PATCH v12 03/34] ARM: GICv3: enable LPIs on the host X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Now that the host part of the ITS code is in place, we can enable the LPIs on each redistributor to get the show rolling. At this point there would be no LPIs mapped, as guests don't know about the ITS yet. Signed-off-by: Andre Przywara Acked-by: Stefano Stabellini --- xen/arch/arm/gic-v3.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c index a559e5e..eda3410 100644 --- a/xen/arch/arm/gic-v3.c +++ b/xen/arch/arm/gic-v3.c @@ -620,6 +620,21 @@ static int gicv3_enable_redist(void) return 0; } +/* Enable LPIs on this redistributor (only useful when the host has an ITS). */ +static bool gicv3_enable_lpis(void) +{ + uint32_t val; + + val = readl_relaxed(GICD_RDIST_BASE + GICR_TYPER); + if ( !(val & GICR_TYPER_PLPIS) ) + return false; + + val = readl_relaxed(GICD_RDIST_BASE + GICR_CTLR); + writel_relaxed(val | GICR_CTLR_ENABLE_LPIS, GICD_RDIST_BASE + GICR_CTLR); + + return true; +} + static int __init gicv3_populate_rdist(void) { int i; @@ -731,11 +746,14 @@ static int gicv3_cpu_init(void) if ( gicv3_enable_redist() ) return -ENODEV; + /* If the host has any ITSes, enable LPIs now. */ if ( gicv3_its_host_has_its() ) { ret = gicv3_its_setup_collection(smp_processor_id()); if ( ret ) return ret; + if ( !gicv3_enable_lpis() ) + return -EBUSY; } /* Set priority on PPI and SGI interrupts */