Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp212783imm; Fri, 21 Sep 2018 13:01:08 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZg1wcPwBdKNHkK82qR8SUVFp1GKQePwEEQVlPuDZZtidGBjq9JV4zC1VoGLzh8anw6Q3nd X-Received: by 2002:a17:902:6b47:: with SMTP id g7-v6mr46413887plt.128.1537560068819; Fri, 21 Sep 2018 13:01:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537560068; cv=none; d=google.com; s=arc-20160816; b=T9cllLW0c4drWK2nnEBVNpbdzlKUJHEoQlXd4qePXanpV7AHZwVFGsql7Xc7VnpgUb U1wjSXB9xLimxBWr6rqax6sAcb1zu5l8WRaPMPkevsXk5qXtDBPMMFvPMfVKzZNXRGyq gU+8SrFvSehinYTkzD7rC6pK3uLUQ7CIk8AVCmhOINdNB2b2pVoj9AsKhTncWvrcvDpG fJMShTj1I3mGgzbb5+TYgqFw1FSEi0kDGwgtS4Jj2fezDuyqrLf7Jr7982V+Ru6+JxYo FDn/wEcjIJiznMdNjlQB/BPuA6v8b8eUmUmlmzyQwDC6oADGQbOLT7+ZccbL5B90PuVi 3vCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=M+CGt0lconyMuwAmb+klNrrXre44zczMKBxsckeBG2E=; b=NK/n+7DHrJMVtZjQx4P1snuqxZDupNGAtuY0qd+PHrV+MlcCpWA71fqRH/MzfrYVVU 3Vo6gQB72gSsCfnp5JmSQ8pLag2eeSk9pZVlv3cKqW+Moi4sGtqixDClujVm8/OBH48G T0aw94Xh/Ekv5XnD+gafPdCATgHnyl0Z9z3giEMDbdGvUXMAYI/2F0HIzTeSh1ukTPMG Qbt+flNV7Q+jd159GGeYhYGd1/ifN8mXI0F+8tzc/frW+no50yOYBzhmwKUa5v5FD2qy fozMk+FKGUuRS2XSXZC3uaiwDP4OgGSF8HhKC8OacG+v7kbEzKTNPNxIWmihL5/dnpUS i/vw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q3-v6si25159940pgv.652.2018.09.21.13.00.53; Fri, 21 Sep 2018 13:01:08 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391517AbeIVBu7 (ORCPT + 99 others); Fri, 21 Sep 2018 21:50:59 -0400 Received: from foss.arm.com ([217.140.101.70]:41360 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391471AbeIVBuq (ORCPT ); Fri, 21 Sep 2018 21:50:46 -0400 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 F1C7E174E; Fri, 21 Sep 2018 13:00:21 -0700 (PDT) Received: from localhost.localdomain (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A63913F5BD; Fri, 21 Sep 2018 13:00:21 -0700 (PDT) From: Marc Zyngier To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Ard Biesheuvel , Jeremy Linton , Jeffrey Hugo , Thomas Gleixner , Jason Cooper Subject: [PATCH 09/10] irqchip/gic-v3-its: Register LPI tables with EFI config table Date: Fri, 21 Sep 2018 20:59:53 +0100 Message-Id: <20180921195954.21574-10-marc.zyngier@arm.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180921195954.21574-1-marc.zyngier@arm.com> References: <20180921195954.21574-1-marc.zyngier@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Upon enabling a redistributor, let's register the allocated tables with the EFI table that tracks the memory reservations. Signed-off-by: Marc Zyngier --- drivers/irqchip/irq-gic-v3-its.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 4d9604dd6fb1..4912dc57bf07 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -1628,6 +1629,14 @@ static void its_free_prop_table(struct page *prop_page) get_order(LPI_PROPBASE_SZ)); } +static int gic_reserve_range(phys_addr_t addr, unsigned long size) +{ + if (efi_enabled(EFI_CONFIG_TABLES)) + return efi_mem_reserve_persistent(addr, size); + + return 0; +} + static int __init its_alloc_lpi_prop_table(void) { if (gic_rdists->flags & RDIST_FLAGS_RD_TABLES_PREALLOCATED) { @@ -1655,6 +1664,8 @@ static int __init its_alloc_lpi_prop_table(void) gic_rdists->prop_table_pa = page_to_phys(page); gic_rdists->prop_table_va = page_address(page); + WARN_ON(gic_reserve_range(gic_rdists->prop_table_pa, + LPI_PROPBASE_SZ)); } pr_info("GICv3: using LPI property table @%pa\n", @@ -2049,6 +2060,7 @@ static void its_cpu_init_lpis(void) pend_page = gic_data_rdist()->pend_page; paddr = page_to_phys(pend_page); + WARN_ON(gic_reserve_range(paddr, LPI_PENDBASE_SZ)); /* set PROPBASE */ val = (gic_rdists->prop_table_pa | -- 2.18.0