From patchwork Mon Aug 26 19:00:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 11115265 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E69201395 for ; Mon, 26 Aug 2019 19:01:32 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C3E3622CBB for ; Mon, 26 Aug 2019 19:01:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Ov40Wjx0"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="B26GOpyr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C3E3622CBB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=soleen.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Tq8lbJCqNvbe/WSJnbU4nW2u/sClXhdiRE9g31InAME=; b=Ov40Wjx04IQf4g bhz7RMiIjeeLYnBdHD2410Ertl1IE/GmNhYBDg1k3zpQJAM4sRnRE4UMHvVTmA/UAywZH/lobwPNW cZ4ipdBbzqpWc4yRLN6539OJAnv5dpO1ryLJamO9UXBlIXjmDpx1DI7tgHLAfuRFGo7FUQsclS70T B8qTRMumYZoMM0PueoF4GYKiuYHUi/z8llExF56j/S+ANDAyXwpCI8ukiAEK/wNJ8+ucA+FyRMxNE bn79KNZps+kNPR5uS4oQqh8G5SQ52wdhV4hwaf1d0yk1i3jHbnE61jGcvdzzRsJvul2P4CzhkEYog l9KFOb2IUcgroqQdGTXA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i2KFA-0007pS-26; Mon, 26 Aug 2019 19:01:32 +0000 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i2KEe-0006yB-GF for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2019 19:01:03 +0000 Received: by mail-qt1-x843.google.com with SMTP id g4so9113005qtq.7 for ; Mon, 26 Aug 2019 12:01:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=MVGzHS9ibRvktU9gzuXWTCeM/ZsMv8ZNEfXsJO3ZoxM=; b=B26GOpyrtMcVplPhl7Il/MGEWWA8xd6bEnjFdWoHib2Rq2CQ2PBaL6pitAD90OeatG tvJzrwjReaiCAXbgM7nLmeUHIJ8/TZBf0kkeT01e/VjRWbOWaZD4xgFGJy/70LhHlAsY UnjEME49+kC2iR55o2+mlOizKCmy3OB/EctD8PVQHoI6XHSMF53PwgEfahO3jykEsLIb rx3c0uE2DuomPLwTqb/gjWEYyvIfaBDdYx+79C/aU9O3JgLSowUa+EQVq5O5HLoHhJUX Vo7WzIj4qCeHmTkqlfQYvj9mS8pVTI0zrxWAM+EBdsWGT1jbV7TzXerLWaktA4hBPL5w 1G6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MVGzHS9ibRvktU9gzuXWTCeM/ZsMv8ZNEfXsJO3ZoxM=; b=rASCVD/Kujm7eWd28q2WTDqnGtCDvLoyCbMKHZlnUvgZKT5zqaR7gPtJkAVo5hvoAL 9nRHHEN8bsU1h+Pzzl3FGY6s17KUkgTjXuv1AN/IHmdeoLU2rN0h6SHx0d1zj5Sc6mAN z1QrKTgBq5i7TIFzTUvsx0TQm08E4y+mW39Tap8eEVQPH6cZ+l9p/pABXR/9OJYZUFpB jZXjSOhUY9Mhqa4fDyEdhiExTT6XVU+cGU8WOulzSFZKcwL8po9//QEcQJ5bqKmN0Zuv oPok/Nx0ki24HHdAMPYZdb9+5chuDUd5hvRJHaBYMzT7jPmUm2tS1CTtvcb+ODEu6EFp SJhA== X-Gm-Message-State: APjAAAUszM85dBrRoDRnanmoIkajaopvq5h3PeH3/TOwzyoTSFGmQeEl 4tLXxWtVwkv59YCdkrOqeD8cZg== X-Google-Smtp-Source: APXvYqxeU7d2ypGYD+w4LlmlZBLQ94N4jLKoJtLpD4qFS3r6JUQs+pZr0N0cUZuPWjoo9GSHYRXaKw== X-Received: by 2002:ac8:64a:: with SMTP id e10mr18640949qth.30.1566846059770; Mon, 26 Aug 2019 12:00:59 -0700 (PDT) Received: from localhost.localdomain (c-73-69-118-222.hsd1.nh.comcast.net. [73.69.118.222]) by smtp.gmail.com with ESMTPSA id o45sm8614377qta.65.2019.08.26.12.00.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 12:00:59 -0700 (PDT) From: Pavel Tatashin To: pasha.tatashin@soleen.com, jmorris@namei.org, sashal@kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, marc.zyngier@arm.com, james.morse@arm.com, vladimir.murzin@arm.com, mark.rutland@arm.com Subject: [PATCH v1 1/6] rqchip/gic-v3-its: reset prop table outside of allocation Date: Mon, 26 Aug 2019 15:00:51 -0400 Message-Id: <20190826190056.27854-2-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190826190056.27854-1-pasha.tatashin@soleen.com> References: <20190826190056.27854-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190826_120100_537311_374B08E9 X-CRM114-Status: GOOD ( 11.09 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:843 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org In preparation of adding another variant of allocation, move the resetting outside of the current allocator. Signed-off-by: Pavel Tatashin --- drivers/irqchip/irq-gic-v3-its.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 1b5c3672aea2..ada18748ed1c 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -1621,15 +1621,7 @@ static void gic_reset_prop_table(void *va) static struct page *its_allocate_prop_table(gfp_t gfp_flags) { - struct page *prop_page; - - prop_page = alloc_pages(gfp_flags, get_order(LPI_PROPBASE_SZ)); - if (!prop_page) - return NULL; - - gic_reset_prop_table(page_address(prop_page)); - - return prop_page; + return alloc_pages(gfp_flags, get_order(LPI_PROPBASE_SZ)); } static void its_free_prop_table(struct page *prop_page) @@ -1685,7 +1677,6 @@ static int __init its_setup_lpi_prop_table(void) gic_rdists->prop_table_va = memremap(gic_rdists->prop_table_pa, LPI_PROPBASE_SZ, MEMREMAP_WB); - gic_reset_prop_table(gic_rdists->prop_table_va); } else { struct page *page; @@ -1703,6 +1694,7 @@ static int __init its_setup_lpi_prop_table(void) WARN_ON(gic_reserve_range(gic_rdists->prop_table_pa, LPI_PROPBASE_SZ)); } + gic_reset_prop_table(gic_rdists->prop_table_va); pr_info("GICv3: using LPI property table @%pa\n", &gic_rdists->prop_table_pa); @@ -3079,6 +3071,7 @@ static int its_vpe_irq_domain_alloc(struct irq_domain *domain, unsigned int virq its_lpi_free(bitmap, base, nr_ids); return -ENOMEM; } + gic_reset_prop_table(page_address(vprop_page)); vm->db_bitmap = bitmap; vm->db_lpi_base = base; From patchwork Mon Aug 26 19:00:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 11115267 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DF1C21395 for ; Mon, 26 Aug 2019 19:01:51 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BC5AD2070B for ; Mon, 26 Aug 2019 19:01:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="exKPd667"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="UFXzaaLC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BC5AD2070B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=soleen.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=48JdhFAdd810MYy8dLAtc+E8wFsmz2jqoOW/KUT1l+k=; b=exKPd667RGrwWZ CrHxbBx7YNljKTQn2xD20PWDr+ffH/vLQEs7UWPUj74Dug4+2Jcg3xagKZrhSoSDglg8xPn+UaHfm ceWDRz2n5WBndc2LQT0NGe7o0HXQh6V1YfkeaCIBNYBkUxDx84ODDmjcBImT9lWwlcOEtBPALWwyv aUaefPZLmJrHgQ/5BLc64FfKkvzwJFWcbG5gQoIA4QuaJtc7QAsk3LdjIkUUi8Sz1LHihFkKMV7Ly FTK8nUuoDG1x5v3FYWxu4F6aOaD0W350Kkp+D9xnENoiBJFZNST8ELQnz2vIJlG3MRZPSzqQZW4Od zlNzzgTXKZpdhkwjjPkg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i2KFO-00082t-OK; Mon, 26 Aug 2019 19:01:46 +0000 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i2KEf-0006yz-RU for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2019 19:01:03 +0000 Received: by mail-qt1-x843.google.com with SMTP id q64so7291706qtd.5 for ; Mon, 26 Aug 2019 12:01:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=2Iyu8V2mhRgac8+S13ID8s2986xy5pxZvhk9T7S5rNU=; b=UFXzaaLCAVwRSz6XEcr9mJF5kHCBrdjGe3QkcYu3MGkKN44wfFfrzlG0jc7ANzJ77n 9EoRiykDzx5lyexiZKGga2j3mHmXj7jLWKeImUzAxoVVED14tv/gZEJHmCbMexLFIPAF 5ZytoKvyGY0XeEXjN9ofyjZRs3CXeuzBSR6meTOyX137+CHIWynDofBLwZgxFIeOEuwU OK7JwW7xuggSckOozTZhHrg1yHzheQ686DtTHSePs2X0r2pswsBkvl7gwF6Fso0bHiKp JpJ0aXsoIgjae8qYFNMcuLsCVjUn7vzSman7d/ATv3DURMO5i0LYjOOZX24xNTqRoQ4o 0w0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2Iyu8V2mhRgac8+S13ID8s2986xy5pxZvhk9T7S5rNU=; b=EptbNqVleG8IM4PGs/ae8MLaKXMXeTYE08L6G6RjwOcalx3y8X7evI6Ph6ywqa6iKV CK9G03g6xx97WbpfbwQ8YqJNrZTvfhm8CcgXUlBrW17XZy7QBbQizvv+8XVq5h8/DXd8 HEQ2WZcv/cBA6BUWiIXHOXz/oow4S9OOulKa88mCnRpgpcKb/6vLCglxmjH9fwnrI0pC 0e5+vYhKxyDUWZUuoaMw1cVw3ftrC9dK9UUSmMeR5aQUyw/BResNkAIIUJ2yjCO3xCz3 /sQV/bwkeMK9yn62W6t/1nyoXLBOt5B6OOje7K44hBLksgqkbC3yN8k2RpwD0G0zO9xo DCOA== X-Gm-Message-State: APjAAAUUTihRJlFRR+u4ms/8/Ruh1siZu8chU6e8S23ph6eqBTwAdOJi I5qAWIhgPiqgyL6zWGgQwWWGmg== X-Google-Smtp-Source: APXvYqwJEoLilU8DEOh3KuHyqH0S1JmiSp9yFcsGVAyDCCyoqq7RSrfnW4/Garo6AgPuH9RBmHyTWg== X-Received: by 2002:ac8:317a:: with SMTP id h55mr19163671qtb.105.1566846061160; Mon, 26 Aug 2019 12:01:01 -0700 (PDT) Received: from localhost.localdomain (c-73-69-118-222.hsd1.nh.comcast.net. [73.69.118.222]) by smtp.gmail.com with ESMTPSA id o45sm8614377qta.65.2019.08.26.12.00.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 12:01:00 -0700 (PDT) From: Pavel Tatashin To: pasha.tatashin@soleen.com, jmorris@namei.org, sashal@kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, marc.zyngier@arm.com, james.morse@arm.com, vladimir.murzin@arm.com, mark.rutland@arm.com Subject: [PATCH v1 2/6] rqchip/gic-v3-its: use temporary va / pa variables Date: Mon, 26 Aug 2019 15:00:52 -0400 Message-Id: <20190826190056.27854-3-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190826190056.27854-1-pasha.tatashin@soleen.com> References: <20190826190056.27854-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190826_120101_983991_899F64EC X-CRM114-Status: GOOD ( 10.27 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:843 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org This is a cleanup, that will help later when a variant that does not require memremap is added. Signed-off-by: Pavel Tatashin --- drivers/irqchip/irq-gic-v3-its.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index ada18748ed1c..656b6c6e1bf8 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -1668,15 +1668,17 @@ static int gic_reserve_range(phys_addr_t addr, unsigned long size) static int __init its_setup_lpi_prop_table(void) { if (gic_rdists->flags & RDIST_FLAGS_RD_TABLES_PREALLOCATED) { + unsigned long pa; u64 val; + void *va; val = gicr_read_propbaser(gic_data_rdist_rd_base() + GICR_PROPBASER); lpi_id_bits = (val & GICR_PROPBASER_IDBITS_MASK) + 1; - gic_rdists->prop_table_pa = val & GENMASK_ULL(51, 12); - gic_rdists->prop_table_va = memremap(gic_rdists->prop_table_pa, - LPI_PROPBASE_SZ, - MEMREMAP_WB); + pa = val & GENMASK_ULL(51, 12); + va = memremap(pa, LPI_PROPBASE_SZ, MEMREMAP_WB); + gic_rdists->prop_table_pa = pa; + gic_rdists->prop_table_va = va; } else { struct page *page; From patchwork Mon Aug 26 19:00:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 11115269 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F06801395 for ; Mon, 26 Aug 2019 19:02:09 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CD8952070B for ; Mon, 26 Aug 2019 19:02:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nxaCdSCp"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="I0284+Uk" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CD8952070B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=soleen.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UYaDpaJIhbkYsZTlrUcepfUbLF7tYJ7RSxH+Sp6x848=; b=nxaCdSCpxbfFgm UJ5go795ZogpMycRTmMDuWP/OCmUGt7ySxDGEsv1MVzis7naRE+4oIocg2bxmLPKDUV/VsMGaD6Cu TrNUS1yzszISSymF3GYduj//fwsJGEL6tTdml3mlzEuKxYf9kdkkNvHuP72vOnFE1vQM9U0avdELl KZUPJFaz0RDKOl+IoF0YBzpiVqE/dC2GU/73IJwCXXrGGHfQ+6S9QqfcMoG+kLb91JMx9NODjSWKq /MOxSZsGZ85XXShEK5bE97wH7j5ZLLknriPgIaRfHPIomll4BfhcQ0PLa4G2yoWs22llz1m7GGydG cgVsbbPN62OdPQ45hQ+A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i2KFl-0008L9-4B; Mon, 26 Aug 2019 19:02:09 +0000 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i2KEi-0006zo-Fq for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2019 19:01:05 +0000 Received: by mail-qk1-x744.google.com with SMTP id m2so14920388qkd.10 for ; Mon, 26 Aug 2019 12:01:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=CccJyJOMWnqZNze84cEuacicNWkxG2JBW1Co8t/7GHg=; b=I0284+UkE2KRe/Q87KW/ZDOZ0NRLyZ5y2WK3GF9B8oVeaMsu4inuS3OYe5XqIF1vCo eSOQX+eykZNjiDXyhXVlZ3NueKf7GCab1T0/xy1AKMvaD45089SUJauoau3gT/VqvXsn eNv3bynIT8Q0UOTvohhzTlq3c/vJHTpou9QSboH+3la93R7QO9Id6GACC4fhqFwMwPIz a/U20xXR+sBysdvk2sRmuZQ8HPJLe/+5kRs8lVPycQ+vJq3Is3jFq8XDJcq6sfw510xN 6KbSpr1vDru+n59CnWFw4rgMw55N4Xcmh/+/tcGzAYti3jEjzdjllLOni6KaNu/sfJ7I ZHnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CccJyJOMWnqZNze84cEuacicNWkxG2JBW1Co8t/7GHg=; b=ielqIvHcQXZ+KjVED6M2GhR4XzJOa0sHjlmqJMOjYCeNrASRcMNRP6aezC/kMDdbia 15KWfloV8P+pL8MSuENHkMBlquSdqWdUy3WRG6+PEQ4roOGecy++P0qLh64+8GEJAGLV X+WAb8fLsP5X2kmjftlQq5GJMohKjfx+qJ2673HJqrFpjdmjASNlvJ5qYsN6LYukpKRo A2ILclEt7smf4g4+WGoN4VNUCwcDmGv2u+HJGufbQH9WTi3MqUpBe2/IYSxDmgNmK7x4 I12M7pziLLDku2Q99GTts11lMqCkBxHEhWKDcc6ePQFVzfMmsWSfkxd9NwzppunJSe9m wG2w== X-Gm-Message-State: APjAAAXMFr6a6Ft5h4YvXFlC23tJEs3agYNqVdCmfW+QAwWaX9+qRxzS 7qvPojt5NQCK299C8NDIRTZZGA== X-Google-Smtp-Source: APXvYqzkeM4d2xoox7UrW26qsfl9DIQeUgb3ebwIZYrqCOeIByY+iEP0xv1YBmkPy1xY46M7C9jK0w== X-Received: by 2002:a05:620a:16dc:: with SMTP id a28mr16541779qkn.200.1566846062457; Mon, 26 Aug 2019 12:01:02 -0700 (PDT) Received: from localhost.localdomain (c-73-69-118-222.hsd1.nh.comcast.net. [73.69.118.222]) by smtp.gmail.com with ESMTPSA id o45sm8614377qta.65.2019.08.26.12.01.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 12:01:01 -0700 (PDT) From: Pavel Tatashin To: pasha.tatashin@soleen.com, jmorris@namei.org, sashal@kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, marc.zyngier@arm.com, james.morse@arm.com, vladimir.murzin@arm.com, mark.rutland@arm.com Subject: [PATCH v1 3/6] rqchip/gic-v3-its: add reset pending table function Date: Mon, 26 Aug 2019 15:00:53 -0400 Message-Id: <20190826190056.27854-4-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190826190056.27854-1-pasha.tatashin@soleen.com> References: <20190826190056.27854-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190826_120104_603211_DB17E815 X-CRM114-Status: GOOD ( 10.12 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:744 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add function that is similar to gic_reset_prop_table but for pending table. Signed-off-by: Pavel Tatashin --- drivers/irqchip/irq-gic-v3-its.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 656b6c6e1bf8..124e2cb890cd 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -1989,17 +1989,23 @@ static int its_alloc_collections(struct its_node *its) return 0; } +static void gic_reset_pending_table(void *va) +{ + memset(va, 0, LPI_PENDBASE_SZ); + + /* Make sure the GIC will observe the zero-ed page */ + gic_flush_dcache_to_poc(va, LPI_PENDBASE_SZ); +} + static struct page *its_allocate_pending_table(gfp_t gfp_flags) { struct page *pend_page; - pend_page = alloc_pages(gfp_flags | __GFP_ZERO, - get_order(LPI_PENDBASE_SZ)); + pend_page = alloc_pages(gfp_flags, get_order(LPI_PENDBASE_SZ)); if (!pend_page) return NULL; - /* Make sure the GIC will observe the zero-ed page */ - gic_flush_dcache_to_poc(page_address(pend_page), LPI_PENDBASE_SZ); + gic_reset_pending_table(page_address(pend_page)); return pend_page; } From patchwork Mon Aug 26 19:00:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 11115271 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4090C1395 for ; Mon, 26 Aug 2019 19:02:30 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1D8322070B for ; Mon, 26 Aug 2019 19:02:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WoWk7du6"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="ZPsZFx07" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1D8322070B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=soleen.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zzTEy/tO1LvhoiVozoPxH/FZsjBBlf1pmTYEyDht0xo=; b=WoWk7du6/smpK8 pw74xOVjSmaMJuDxs1ZslTJM8qbbC8W0Eeoy0OotsuQ/5Sdrd/2X2m7m2pZOSLxaMvcE3JBSckRZs 1ehioeEuv2mjlRKXh6sh9Ip8Qe1mEpMLeJZh7+FmB+0Yguj1b8KHUU181mgyk6WgWS84StHOHa3ub 1J0uxM+H0SORYZlIR+o2x093ImBPtQJI6nAGD6oAbHIiqMRIn8lM76rwGD0YZGZGiN3fKmnZdXjF3 hK34FWreu+njxuCDdaY+Ed57L66UtbL7mk6dvxxLY4/1gXUOxN0AbrPeqieo0nB0GEIhM4Hbb6sit tdPxxykyOhRZ14CFt2VA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i2KG1-0000GB-0I; Mon, 26 Aug 2019 19:02:25 +0000 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i2KEi-00072W-Ft for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2019 19:01:07 +0000 Received: by mail-qk1-x744.google.com with SMTP id 201so14933159qkm.9 for ; Mon, 26 Aug 2019 12:01:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=0G4wOYVegWG72k6oGUeWPK9tZ0VMm8uCy6edjZslp4c=; b=ZPsZFx07m0tAJXmqzDFkTOaZzOQz/AQuMAjRi257nF9B1rGb5m9feEUOR3OKQox5VN Q/HB83bhvJZOLD2pOOSznKKi6XqzqCMuS/HwsLqi1sU6qC1NvDfdupTOqPN64xmJTRKg Uxj4ePug02LYzhTt0KRIeloMKuigRMiCRq0bxTah7b3VJKt2V/HAVk/LSlC3DlfCrOvK 6SIbC9drhIvs6jk1NVSauM5S5HwQyUdWRjrTXBiH+fAJrKqk4Zba9eBGP9r0Ao8A/dMd iEaGpS5LoxKgrr22zrvMWF4fyKn/QHJ/4exThlvCi19XKYbgYq/HYbqI4e2FLoS5dkJn da4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0G4wOYVegWG72k6oGUeWPK9tZ0VMm8uCy6edjZslp4c=; b=qaMzM4u4RzPxmIDLiQ1+6flh+BBWHhetj8iTv1Gtw2wCaeAOIjVoxPro+GAyGOUihk 4w2Ac9IRd86dgkRo7jN/QSQXXpvfiIkaO6ZUmG+sX+pafosnFgMA/Y5C8fc4gR+L9pNJ MkqOEebuT1hYEkDrOeMyUBm+e8eBPeraciARvnvB4/lbnKcj0CLI6C6XJF3KZLjoLnLq G/aetk36xmF9DlfRKi8/Q1lvjI2BcR7yHJEgejRVh6f5JO2OiePKXxzpK6lQvypHApk9 W4x68PRC+0BnrhJlv+Guut99XytqVXOsk5WsmqzPIbfWQuQbdsalzg1DNUhU6AIlW37W GVDQ== X-Gm-Message-State: APjAAAWR5wgtRqSjEDGeT5jX9fH3PAJwypQyv+s9ZjJRQtEAY5s3kWzn 9L2QrerY/+wuAy+CMhwLBh8Q3w== X-Google-Smtp-Source: APXvYqyQpwd1cHJy+7egGM9XZ830LpQuYxMo23YJ3RHaBifSxKeOu/wMGe2mnwjs/L5INtNlBUcVYA== X-Received: by 2002:a05:620a:b:: with SMTP id j11mr18037810qki.352.1566846063737; Mon, 26 Aug 2019 12:01:03 -0700 (PDT) Received: from localhost.localdomain (c-73-69-118-222.hsd1.nh.comcast.net. [73.69.118.222]) by smtp.gmail.com with ESMTPSA id o45sm8614377qta.65.2019.08.26.12.01.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 12:01:03 -0700 (PDT) From: Pavel Tatashin To: pasha.tatashin@soleen.com, jmorris@namei.org, sashal@kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, marc.zyngier@arm.com, james.morse@arm.com, vladimir.murzin@arm.com, mark.rutland@arm.com Subject: [PATCH v1 4/6] rqchip/gic-v3-its: move reset pending table outside of allocator Date: Mon, 26 Aug 2019 15:00:54 -0400 Message-Id: <20190826190056.27854-5-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190826190056.27854-1-pasha.tatashin@soleen.com> References: <20190826190056.27854-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190826_120104_605009_0FFBA1FA X-CRM114-Status: GOOD ( 11.70 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:744 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Again, in preparation of adding a new allocator, move the reset function outside of the current allocator. Signed-off-by: Pavel Tatashin --- drivers/irqchip/irq-gic-v3-its.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 124e2cb890cd..d5f3508ca11f 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -1999,15 +1999,7 @@ static void gic_reset_pending_table(void *va) static struct page *its_allocate_pending_table(gfp_t gfp_flags) { - struct page *pend_page; - - pend_page = alloc_pages(gfp_flags, get_order(LPI_PENDBASE_SZ)); - if (!pend_page) - return NULL; - - gic_reset_pending_table(page_address(pend_page)); - - return pend_page; + return alloc_pages(gfp_flags, get_order(LPI_PENDBASE_SZ)); } static void its_free_pending_table(struct page *pt) @@ -2064,6 +2056,7 @@ static int __init allocate_lpi_tables(void) pr_err("Failed to allocate PENDBASE for CPU%d\n", cpu); return -ENOMEM; } + gic_reset_pending_table(page_address(pend_page)); gic_data_rdist_cpu(cpu)->pend_page = pend_page; } @@ -3007,6 +3000,7 @@ static int its_vpe_init(struct its_vpe *vpe) its_vpe_id_free(vpe_id); return -ENOMEM; } + gic_reset_pending_table(page_address(vpt_page)); if (!its_alloc_vpe_table(vpe_id)) { its_vpe_id_free(vpe_id); From patchwork Mon Aug 26 19:00:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 11115275 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 221011398 for ; Mon, 26 Aug 2019 19:03:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F30392070B for ; Mon, 26 Aug 2019 19:03:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="J1X2wAT6"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="jvSafae/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F30392070B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=soleen.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cCGeTbcNY84oEVzQlnabnU273QiOUENNIPesv1uUDJ8=; b=J1X2wAT661QlKW Z1nUQKk0nzzRQfXYDnraE+xAWUD3Di7QkocHCNsA7OlnR6bxr3VdLe+WvzqKEDW2qoG1yZfj7lMmn yvbLcnlCwMtykgBQjgAt0q/9meGSNWUQBOfsw5DNJxVSpwUy9YscaRMPO/2QMatXz1EBMdxFuP8u+ QXOoL7W/cEFy+YzL5U0UEH9K5Kac4gtRX/HBxf8oN9iaMvLbQ+cXwFR3YMcaVhREFoTRd4GwKxva3 a4FpwMJCgP8J3agfzS78o66EJGAj9Sqn3QI4CmBTG+TzDqCr5wsDbGffD/8ArQ6LtYKQH+yQi3QCq 3QEJUWo6CMI/Uow1o2aw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i2KGZ-0000nl-0e; Mon, 26 Aug 2019 19:02:59 +0000 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i2KEj-0007Ah-M2 for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2019 19:01:08 +0000 Received: by mail-qk1-x743.google.com with SMTP id p13so14926268qkg.13 for ; Mon, 26 Aug 2019 12:01:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=KCVg9aX8Ei31UqOBsuMHmMbIQ0RCV8gvQ+BUD1iKe9c=; b=jvSafae/Pvhx1ePY9KHCUAHQxBA0240DaYA2EEYIeJv90j9mUT/owS3v1JM2H2Fbgm Gz6u5l9d2paU6NUyVT7sP3J0+xSnFnzr+3EwrP/3kag9XqVwqJUPqQFRtso7/6a0l0HI q/R6/ebth1XnoCuJESeeYoO1XnP2X5HIG1tl+a5dPDYmj+FO2tdCtnWIu832yz+11bXP J9AC/S80/rSdJsITUCH2lUO4rZwcsp1g7kgxhtaYD0QHAYSqcyZIQ3+FSdFqqXSv6KiJ jERTTw7XIJ8w4vdbznCwiS6UtMSG6hhJ5r5DEisniwbgyz9h+GbMSj5yFTCaIUW5f9jl wy4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KCVg9aX8Ei31UqOBsuMHmMbIQ0RCV8gvQ+BUD1iKe9c=; b=XOATtKZ5q91dJLK9LRwe4QdN5j2MARqKFP5dq3h0Guaq4glZ6bY7sFDZPH83vvoA2s QzgFvaNZw8V0NnrN6ORs7nj/UVeodLE0mHdaLPn8OiG+DC8GuOMwuO3DmduxeReHcGfZ sdT8txje7JuVXoayZdrxtOB2Pl42d0r0e7fJNYHQ0io2IiUb2F3fQJIqYSz0bxDKjj51 YTeyn0Zq9K2HhM/ApsMrOdkKLMKn52uYBIy5Pz+6L4u6v6/myOPoOq17LVg37pTcYeKW JmxF/7/I3BYwFyncge8wB4mauzIsfCUg83ShIVzWBFPU+PHiQYZ7MlJP5ezvul4G+zBl CmdQ== X-Gm-Message-State: APjAAAUS0sHo+oRCb4dYaCKPw+9Dfh1nu13WN6Eowx3q/KZl7SoT8rtv SmKV6KNysm5RCyE1QX5+VJyhmw== X-Google-Smtp-Source: APXvYqyHi/lgyXzbqvh1IW/JvUmfZeQrgzncbclhhidqt/Ua9XVbZyYnS+d2hbmlaFxUN3tJbJpaww== X-Received: by 2002:a37:bac3:: with SMTP id k186mr17515757qkf.61.1566846064932; Mon, 26 Aug 2019 12:01:04 -0700 (PDT) Received: from localhost.localdomain (c-73-69-118-222.hsd1.nh.comcast.net. [73.69.118.222]) by smtp.gmail.com with ESMTPSA id o45sm8614377qta.65.2019.08.26.12.01.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 12:01:04 -0700 (PDT) From: Pavel Tatashin To: pasha.tatashin@soleen.com, jmorris@namei.org, sashal@kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, marc.zyngier@arm.com, james.morse@arm.com, vladimir.murzin@arm.com, mark.rutland@arm.com Subject: [PATCH v1 5/6] rqchip/gic-v3-its: move reset pending table outside of allocator Date: Mon, 26 Aug 2019 15:00:55 -0400 Message-Id: <20190826190056.27854-6-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190826190056.27854-1-pasha.tatashin@soleen.com> References: <20190826190056.27854-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190826_120105_773430_CEBAC627 X-CRM114-Status: GOOD ( 16.68 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:743 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Allow to use reserved memory for interrupt controller tables. Currently, it is not possible to do kexec reboots without possible memory corruption using device tree and GICv3 interrupt controller. GICv3 can be configured once during boot, and location of tables cannot be changed thereafter. The fix is to allow to reserve memory region in interrupt controller device property, and use it to do allocations. Signed-off-by: Pavel Tatashin --- drivers/irqchip/irq-gic-v3-its.c | 82 ++++++++++++++++++++++++++++---- 1 file changed, 72 insertions(+), 10 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index d5f3508ca11f..aeda8760cc4e 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -47,6 +47,54 @@ static u32 lpi_id_bits; +/* + * Describes reserved memory region in interrupt controller. + * The memory reserved: [pa_start, pa_end) + */ +struct of_resv { + unsigned long pa_start; + unsigned long pa_end; +}; + +static struct page __init *get_of_page(struct of_resv *resv, unsigned long size) +{ + unsigned long pa = ALIGN(resv->pa_start, size); + unsigned long pa_next = pa + size; + + /* Check if there is enough memory reserved to do another allocation */ + if (pa_next > resv->pa_end) + return NULL; + + resv->pa_start = pa_next; + memset(phys_to_virt(pa), 0, size); + + return phys_to_page(pa); +} + +/* + * Memory controller might have a reserved memory region to be used for table + * allocations. This is a requirement for kexec reboots. + */ +static void __init its_of_mem_region(struct device_node *node, + struct of_resv **resv, + struct of_resv *resv_buf) +{ + struct device_node *np = of_parse_phandle(node, "memory-region", 0); + struct resource mem_res; + + if (!np) + return; + + if (of_address_to_resource(np, 0, &mem_res)) { + pr_warn("%pOF: address to resource failed\n", np); + return; + } + + resv_buf->pa_start = mem_res.start; + resv_buf->pa_end = mem_res.start + resource_size(&mem_res); + *resv = resv_buf; +} + /* * We allocate memory for PROPBASE to cover 2 ^ lpi_id_bits LPIs to * deal with (one configuration byte per interrupt). PENDBASE has to @@ -1665,7 +1713,7 @@ static int gic_reserve_range(phys_addr_t addr, unsigned long size) return 0; } -static int __init its_setup_lpi_prop_table(void) +static int __init its_setup_lpi_prop_table(struct of_resv *resv) { if (gic_rdists->flags & RDIST_FLAGS_RD_TABLES_PREALLOCATED) { unsigned long pa; @@ -1676,7 +1724,10 @@ static int __init its_setup_lpi_prop_table(void) lpi_id_bits = (val & GICR_PROPBASER_IDBITS_MASK) + 1; pa = val & GENMASK_ULL(51, 12); - va = memremap(pa, LPI_PROPBASE_SZ, MEMREMAP_WB); + if (resv) + va = phys_to_virt(pa); + else + va = memremap(pa, LPI_PROPBASE_SZ, MEMREMAP_WB); gic_rdists->prop_table_pa = pa; gic_rdists->prop_table_va = va; } else { @@ -1685,7 +1736,10 @@ static int __init its_setup_lpi_prop_table(void) lpi_id_bits = min_t(u32, GICD_TYPER_ID_BITS(gic_rdists->gicd_typer), ITS_MAX_LPI_NRBITS); - page = its_allocate_prop_table(GFP_NOWAIT); + if (resv) + page = get_of_page(resv, LPI_PROPBASE_SZ); + else + page = its_allocate_prop_table(GFP_NOWAIT); if (!page) { pr_err("Failed to allocate PROPBASE\n"); return -ENOMEM; @@ -2009,7 +2063,8 @@ static void its_free_pending_table(struct page *pt) /* * Booting with kdump and LPIs enabled is generally fine. Any other - * case is wrong in the absence of firmware/EFI support. + * case is wrong in the absence of firmware/EFI support or reserve-memory + * in device tree for interrupt controller. */ static bool enabled_lpis_allowed(void) { @@ -2023,7 +2078,7 @@ static bool enabled_lpis_allowed(void) return gic_check_reserved_range(addr, LPI_PROPBASE_SZ); } -static int __init allocate_lpi_tables(void) +static int __init allocate_lpi_tables(struct of_resv *resv) { u64 val; int err, cpu; @@ -2039,7 +2094,7 @@ static int __init allocate_lpi_tables(void) pr_info("GICv3: Using preallocated redistributor tables\n"); } - err = its_setup_lpi_prop_table(); + err = its_setup_lpi_prop_table(resv); if (err) return err; @@ -2051,7 +2106,10 @@ static int __init allocate_lpi_tables(void) for_each_possible_cpu(cpu) { struct page *pend_page; - pend_page = its_allocate_pending_table(GFP_NOWAIT); + if (resv) + pend_page = get_of_page(resv, LPI_PENDBASE_SZ); + else + pend_page = its_allocate_pending_table(GFP_NOWAIT); if (!pend_page) { pr_err("Failed to allocate PENDBASE for CPU%d\n", cpu); return -ENOMEM; @@ -3957,16 +4015,20 @@ int __init its_init(struct fwnode_handle *handle, struct rdists *rdists, struct irq_domain *parent_domain) { struct device_node *of_node; + struct of_resv resv_buf; + struct of_resv *resv = NULL; struct its_node *its; bool has_v4 = false; int err; its_parent = parent_domain; of_node = to_of_node(handle); - if (of_node) + if (of_node) { its_of_probe(of_node); - else + its_of_mem_region(of_node, &resv, &resv_buf); + } else { its_acpi_probe(); + } if (list_empty(&its_nodes)) { pr_warn("ITS: No ITS available, not enabling LPIs\n"); @@ -3975,7 +4037,7 @@ int __init its_init(struct fwnode_handle *handle, struct rdists *rdists, gic_rdists = rdists; - err = allocate_lpi_tables(); + err = allocate_lpi_tables(resv); if (err) return err; From patchwork Mon Aug 26 19:00:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pasha Tatashin X-Patchwork-Id: 11115273 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1F6141398 for ; Mon, 26 Aug 2019 19:02:47 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F03A22070B for ; Mon, 26 Aug 2019 19:02:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="JIHZqTyj"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=soleen.com header.i=@soleen.com header.b="aHKkuUpc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F03A22070B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=soleen.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=G+mjrZDLU9f7UepaoyMRK7rLCutv1GnicoWudzzxNCI=; b=JIHZqTyjfdi3aD KzQ8o2M4bxl561PY0UTFPcWvMoXJK2MyCmHFCQPBn9UzsDOqJzm3Na0V7a5/yMVStejrwepelpTcO BjIj9B7iQ0k9Z+TXVd0lTIXXUwD4HLzg3rKqUrvirYDBFuuomgDc5JMEJUF0L4gP90u4FxDvJHA/p sZz3o+oc+e+QwHcik2CtelbxoYbDtnEFSKf7LG0Z8Wu8ixStTheNgx6q+rRUwyOiocFcZajV9sO1K 60vdb3auHW3ZzhO1oZZDl28W6dYXsSTfI24rIj7dEcMzdXub6FERoWCkh6Z2DvKcLLDcqOSJEhwmS sL60cepGDFG23zC7PRyw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i2KGM-0000aZ-HB; Mon, 26 Aug 2019 19:02:46 +0000 Received: from mail-qk1-x744.google.com ([2607:f8b0:4864:20::744]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i2KEk-0007HA-UM for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2019 19:01:08 +0000 Received: by mail-qk1-x744.google.com with SMTP id m2so14931611qki.12 for ; Mon, 26 Aug 2019 12:01:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=akAei/7tOU3d191zec9Xi+sZBY39XbiNq2fhlUSUGK8=; b=aHKkuUpclP5IMt7wAHzBt9Sc8X4Or7WoFatBAPGA1CH1KYaZWAevUa/XBG1UeD+BiE CuxaGUZR5K1uB/VS2dvay75flTkQXz6bh07bAv/u9Qscje6ZQNLAY0a3RjWlN485tVZy b4bH4m2ELjpF70da/5WIqrJJVF/TA9aaj1ZKQWRXQs4RwJ3NvZlrgGPsgn1DVPqyNY1Y lP7gjWsw5oQgquGCVVGrZTq5l4DaQj8LiJW1jsUNPeMEV0Z4bp6/kkU6UoG9xFgEFmcT s5mW9o4SuGsusoVxrGMX6dZs89KvC4+2cyyABuNj6g/3YvkJyeufYRLhWz+86jrOXIyL 7iLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=akAei/7tOU3d191zec9Xi+sZBY39XbiNq2fhlUSUGK8=; b=PtSLRlfUjXVMe1rXBcDplmXIgpkrsRznFMH1kWnKkr+KERYiyAx/5yEo/jtsWyaxVo EGVdb1wzU2T8fa0/ppJl+YgG/P2ZgI5CaIjdDLVBScdFweod2syBpMKdz1BfuebtqXO4 R0DJD9UhBwYm6ADCjmqhA4/XJhs+46pGzYvDAW/aJem6+HAYcRBJBmX3bUrxcuZAiKdR wg3VDVHQTMwnEirRYsQZDk1Tn2WIdS3BEaIC8sb+EdYWAfuUI0xiBxQG9aiupZBGNHrG ursZ2VP8KFD6nqq6SZMxyn61mE0E0v76DC0i67N5hr4v0gEopyvkekDZ18wvv2N/FxNH nEkQ== X-Gm-Message-State: APjAAAVZ/wi7yZzrRxnVC1KjNBIFCmRPbEiTf+Z5tVn3QuMxn6fGa9VO EgTTw+XdtRrWnJlSU6dVwsRylg== X-Google-Smtp-Source: APXvYqzJXd38pO3iRXZK6ansWFKaAVK7wUwsU2qQ/q6b8pl+RREguA3Jc5PkLVuOG86V0Rto3oaz1Q== X-Received: by 2002:a37:c206:: with SMTP id i6mr17410846qkm.384.1566846066175; Mon, 26 Aug 2019 12:01:06 -0700 (PDT) Received: from localhost.localdomain (c-73-69-118-222.hsd1.nh.comcast.net. [73.69.118.222]) by smtp.gmail.com with ESMTPSA id o45sm8614377qta.65.2019.08.26.12.01.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 12:01:05 -0700 (PDT) From: Pavel Tatashin To: pasha.tatashin@soleen.com, jmorris@namei.org, sashal@kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, marc.zyngier@arm.com, james.morse@arm.com, vladimir.murzin@arm.com, mark.rutland@arm.com Subject: [PATCH v1 6/6] dt-bindings: interrupt-controller: add optional memory-region Date: Mon, 26 Aug 2019 15:00:56 -0400 Message-Id: <20190826190056.27854-7-pasha.tatashin@soleen.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190826190056.27854-1-pasha.tatashin@soleen.com> References: <20190826190056.27854-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190826_120107_073850_6AF8FE4B X-CRM114-Status: UNSURE ( 7.77 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:744 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Allow pre-reserve memory in device tree that can be used in interrupt controller tabes. This memory is required when kexec functionality is needed with GICv3 controler and device trees. Signed-off-by: Pavel Tatashin --- .../bindings/interrupt-controller/arm,gic-v3.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml b/Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml index c34df35a25fc..7640aaa97302 100644 --- a/Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml +++ b/Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml @@ -102,6 +102,13 @@ properties: - $ref: /schemas/types.yaml#/definitions/uint32 - maximum: 4096 # Should be enough? + memory-region: + description: + Memory used to allocate property and pending tables. + Required if kexec functionality is needed. + allOf: + - $ref: /schemas/types.yaml#/definitions/uint64 + msi-controller: description: Only present if the Message Based Interrupt functionnality is