Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7497118ybl; Tue, 24 Dec 2019 03:43:40 -0800 (PST) X-Google-Smtp-Source: APXvYqwZ7uEofHvomsRn62tbKWqqlqFfMgNJdze+KOOhzlcWMv+ra7J8ku80IFzUkDBqij0+8AqH X-Received: by 2002:a05:6830:1e21:: with SMTP id t1mr18369010otr.194.1577187820593; Tue, 24 Dec 2019 03:43:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577187820; cv=none; d=google.com; s=arc-20160816; b=NoOAR0vDPyGeMSnP6eL8X9NyyPgIv9utHXmZa+uei8t3Kc6ZEV40DDOGMR6w8FUvn9 F4w0FjGc/AUSFs8uYLhOyR/y2CVep8+ZHUjkg5Fjr2YnY4NOv9A1cW5JsJy1HRHKHsss qkmmeQt84dVy+BwfKGx52bBuddneB3cWnWUUQKcDhyHFMzaMcB2R8TzP4jmsJ9iA+Jrw M+7Q40q2VGCjmL3b1d1WQgH74xPNhYc+hWTlIX2xRqrfOjvgJDT8dK5uRdn9yvvKlIxm XZCM9lspcMI2qNFl6rajQHPxw8F99KzJZ/FGhg5GJmun90vpm3B6L0fNQU70G1YbTWKo 3bKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=9YdN6BmMfYMx8jh8TPifixqKmuSCseyeBqa2oH8hSgc=; b=rD6NK3yoaYpExsl4VoyoF62wP5nPjPEu5vIJ6IAEJNITzBPc+AkUnZC99da2Tl8CHl yRGplNtsCChOLpcbnORwjc+mzPzcyc8wpXt8eFJMmdLL+KoI6OKp9AClbER/WoYI9FsY XG4szlH6jVFUBlrJ7hduZVYmiA8KlyYKwq5QpIUBD5ySNJ0Immldwpgzqi5ZjNsO/9Y1 spIUzeep01q6cbj/uyS1PgALz0Ll4D6S/77jYv3wa8qtpEz01VOc9uD25eltHQjp8U6w 1aZi8DVgHN+KDMzSarJk2Dnzysm8vMnZ4yvgrec3jbtDS9j0QJWznsONP0/BrVXbPXvd dghA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w26si10476363otl.213.2019.12.24.03.43.28; Tue, 24 Dec 2019 03:43:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726918AbfLXLmh (ORCPT + 99 others); Tue, 24 Dec 2019 06:42:37 -0500 Received: from inca-roads.misterjones.org ([213.251.177.50]:33496 "EHLO inca-roads.misterjones.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726222AbfLXLmh (ORCPT ); Tue, 24 Dec 2019 06:42:37 -0500 Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.lan) by cheepnis.misterjones.org with esmtpsa (TLSv1.2:DHE-RSA-AES128-GCM-SHA256:128) (Exim 4.80) (envelope-from ) id 1iji61-000169-6D; Tue, 24 Dec 2019 12:11:26 +0100 From: Marc Zyngier To: kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org Cc: Eric Auger , James Morse , Julien Thierry , Suzuki K Poulose , Thomas Gleixner , Jason Cooper , Lorenzo Pieralisi , Andrew Murray , Zenghui Yu , Robert Richter Subject: [PATCH v3 17/32] irqchip/gic-v4.1: Map the ITS SGIR register page Date: Tue, 24 Dec 2019 11:10:40 +0000 Message-Id: <20191224111055.11836-18-maz@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191224111055.11836-1-maz@kernel.org> References: <20191224111055.11836-1-maz@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, eric.auger@redhat.com, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, tglx@linutronix.de, jason@lakedaemon.net, lorenzo.pieralisi@arm.com, Andrew.Murray@arm.com, yuzenghui@huawei.com, rrichter@marvell.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on cheepnis.misterjones.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org One of the new features of GICv4.1 is to allow virtual SGIs to be directly signaled to a VPE. For that, the ITS has grown a new 64kB page containing only a single register that is used to signal a SGI to a given VPE. Add a second mapping covering this new 64kB range, and take this opportunity to limit the original mapping to 64kB, which is enough to cover the span of the ITS registers. Signed-off-by: Marc Zyngier --- drivers/irqchip/irq-gic-v3-its.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 48d7ee443544..2f94fae67dfd 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -97,6 +97,7 @@ struct its_node { struct mutex dev_alloc_lock; struct list_head entry; void __iomem *base; + void __iomem *sgir_base; phys_addr_t phys_base; struct its_cmd_block *cmd_base; struct its_cmd_block *cmd_write; @@ -4325,7 +4326,7 @@ static int __init its_probe_one(struct resource *res, struct page *page; int err; - its_base = ioremap(res->start, resource_size(res)); + its_base = ioremap(res->start, SZ_64K); if (!its_base) { pr_warn("ITS@%pa: Unable to map ITS registers\n", &res->start); return -ENOMEM; @@ -4376,6 +4377,13 @@ static int __init its_probe_one(struct resource *res, if (is_v4_1(its)) { u32 svpet = FIELD_GET(GITS_TYPER_SVPET, typer); + + its->sgir_base = ioremap(res->start + SZ_128K, SZ_64K); + if (!its->sgir_base) { + err = -ENOMEM; + goto out_free_its; + } + its->mpidr = readl_relaxed(its_base + GITS_MPIDR); pr_info("ITS@%pa: Using GICv4.1 mode %08x %08x\n", @@ -4389,7 +4397,7 @@ static int __init its_probe_one(struct resource *res, get_order(ITS_CMD_QUEUE_SZ)); if (!page) { err = -ENOMEM; - goto out_free_its; + goto out_unmap_sgir; } its->cmd_base = (void *)page_address(page); its->cmd_write = its->cmd_base; @@ -4456,6 +4464,9 @@ static int __init its_probe_one(struct resource *res, its_free_tables(its); out_free_cmd: free_pages((unsigned long)its->cmd_base, get_order(ITS_CMD_QUEUE_SZ)); +out_unmap_sgir: + if (its->sgir_base) + iounmap(its->sgir_base); out_free_its: kfree(its); out_unmap: -- 2.20.1