From patchwork Mon Jul 28 18:03:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 4635981 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1C48AC0338 for ; Mon, 28 Jul 2014 18:05:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 82AFF2020E for ; Mon, 28 Jul 2014 18:05:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 84F212020F for ; Mon, 28 Jul 2014 18:04:59 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XBpGg-0002Dq-HV; Mon, 28 Jul 2014 18:03:26 +0000 Received: from mail-we0-f174.google.com ([74.125.82.174]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XBpGd-0001tf-4L for linux-arm-kernel@lists.infradead.org; Mon, 28 Jul 2014 18:03:23 +0000 Received: by mail-we0-f174.google.com with SMTP id x48so7904191wes.33 for ; Mon, 28 Jul 2014 11:02:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=3LIVD2dUdOBS2Bxa1SZpxjJgLew+ekYntdxBi+caGH4=; b=F+SdxyreIDhrAP9plTyuOhVDmwHvVqSCZ0TxmnrorMNrRB07A/3Fuqql00Xz7R6tn8 mUCuEIjP1cg0gQhiV0sXLEJRlb8EAnsqpLwZBJzyaNE6IsRu0gM+w7AyCVm6d/yvXrGH Q12Xg+U+Wp0dVotR+KAutOXY7vsJv0K4xg9X530jC+89h4lsZ+juSOZUkPOO0JYHPiC2 WEd+iTYnmfaV0XsC/bGiqBnRWUO3AWzURC7gISmifSnweE4WgD1oEV62ffa8Na0ZhRMN +gYgVzV479oFQN3Ymkx+kqIvjBYp0QW+PvDXSN33DRL7GRjMipT5KRL5ZeueMJRVSbaE YjFA== X-Gm-Message-State: ALoCoQnnvUp3E7RezFCv6AiqyNcoVA0zv3WchyZngikS1AqXnTFg8SFS4H6MvkSADU509SlHwoAP X-Received: by 10.194.237.135 with SMTP id vc7mr53432974wjc.86.1406570578139; Mon, 28 Jul 2014 11:02:58 -0700 (PDT) Received: from mohikan.mushroom.smurfnet.nu (cpc4-cmbg17-2-0-cust71.5-4.cable.virginm.net. [86.14.224.72]) by mx.google.com with ESMTPSA id h3sm51175762wjn.10.2014.07.28.11.02.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Jul 2014 11:02:57 -0700 (PDT) From: Leif Lindholm To: linux-arm-kernel@lists.infradead.org, msalter@redhat.com, catalin.marinas@arm.com Subject: [PATCH] arm64: ignore DT memreserve entries when booting in UEFI mode Date: Mon, 28 Jul 2014 19:03:03 +0100 Message-Id: <1406570583-22848-1-git-send-email-leif.lindholm@linaro.org> X-Mailer: git-send-email 1.7.10.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140728_110323_319896_CB8C176D X-CRM114-Status: GOOD ( 11.21 ) X-Spam-Score: -0.7 (/) Cc: mark.rutland@arm.com, linux-efi@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP UEFI provides its own method for marking regions to reserve, via the memory map which is also used to initialise memblock. So when using the UEFI memory map, ignore any memreserve entries present in the DT. Reported-by: Mark Rutland Signed-off-by: Leif Lindholm Reviewed-by: Mark Rutland Acked-by: Catalin Marinas --- arch/arm64/kernel/efi.c | 2 ++ arch/arm64/mm/init.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c index 14db1f6..7ad17b2 100644 --- a/arch/arm64/kernel/efi.c +++ b/arch/arm64/kernel/efi.c @@ -188,6 +188,8 @@ static __init void reserve_regions(void) if (uefi_debug) pr_cont("\n"); } + + set_bit(EFI_MEMMAP, &efi.flags); } diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index e90c542..58dbf2e 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -151,7 +152,8 @@ void __init arm64_memblock_init(void) memblock_reserve(__pa(swapper_pg_dir), SWAPPER_DIR_SIZE); memblock_reserve(__pa(idmap_pg_dir), IDMAP_DIR_SIZE); - early_init_fdt_scan_reserved_mem(); + if (!efi_enabled(EFI_MEMMAP)) + early_init_fdt_scan_reserved_mem(); /* 4GB maximum for 32-bit only capable devices */ if (IS_ENABLED(CONFIG_ZONE_DMA))