From patchwork Mon Dec 22 19:08:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 42544 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f70.google.com (mail-ee0-f70.google.com [74.125.83.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A8E9425BA1 for ; Mon, 22 Dec 2014 19:13:41 +0000 (UTC) Received: by mail-ee0-f70.google.com with SMTP id b57sf3273585eek.9 for ; Mon, 22 Dec 2014 11:13:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=lmSiRBP+g3pzZn6HlVnoszUM/Ii0z/UP1t2bAPa9cso=; b=LkLJeSfPDUBKsqj9d6N411VC1AenGrBNXxlTKItBbxv+eEb2Vq7WuzqbkC9xK+aM9O G9xHfbrPgcZnUubTkTdQoQJ3PJ5Kroorin/fKi+EW0sLAF8Lbjc7XIY4P6z9N0d8/mhK HsckzqVAkKAN6hFPnK0SIXCNVzPItRtM1Knnbb/osTqSursvJ3p1IQT7jCJKJr+jrc2X E8Wst3zfvfX0PPvPIt+1D5KmxU+Yl66rhHsz83pO9s82V02OTFOqh9S1uvA5cQsl6JlQ lEbkJWZOPw7Dwz77ISDbgGt8uYVjMwdl0uzZ4Rxj84BiYmt5YUoBo4ZGW0m97QLrSAgD WQ/Q== X-Gm-Message-State: ALoCoQnDNTyzPS5oYf6QKHH7x62UDjMMq5wRZ4mUTBBLJ1Y8y8P9P/S46pCq8/o4D9TOGNtEgRks X-Received: by 10.112.159.199 with SMTP id xe7mr7900lbb.21.1419275620885; Mon, 22 Dec 2014 11:13:40 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.4.169 with SMTP id l9ls1711380lal.101.gmail; Mon, 22 Dec 2014 11:13:40 -0800 (PST) X-Received: by 10.153.8.132 with SMTP id dk4mr19496239lad.56.1419275620739; Mon, 22 Dec 2014 11:13:40 -0800 (PST) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id dv9si8719084lbc.63.2014.12.22.11.13.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Dec 2014 11:13:40 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by mail-lb0-f181.google.com with SMTP id l4so4282072lbv.26 for ; Mon, 22 Dec 2014 11:13:40 -0800 (PST) X-Received: by 10.112.125.41 with SMTP id mn9mr9473782lbb.80.1419275620656; Mon, 22 Dec 2014 11:13:40 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.142.69 with SMTP id ru5csp1119034lbb; Mon, 22 Dec 2014 11:13:39 -0800 (PST) X-Received: by 10.68.203.195 with SMTP id ks3mr37940183pbc.104.1419275618994; Mon, 22 Dec 2014 11:13:38 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id ps5si26140745pbc.111.2014.12.22.11.13.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Dec 2014 11:13:38 -0800 (PST) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; 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 1Y38OZ-0000DV-1r; Mon, 22 Dec 2014 19:11:55 +0000 Received: from mail-wi0-f172.google.com ([209.85.212.172]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y38MS-0006Rz-MG for linux-arm-kernel@lists.infradead.org; Mon, 22 Dec 2014 19:09:45 +0000 Received: by mail-wi0-f172.google.com with SMTP id n3so8927144wiv.5 for ; Mon, 22 Dec 2014 11:09:22 -0800 (PST) X-Received: by 10.180.87.36 with SMTP id u4mr33586439wiz.20.1419275362296; Mon, 22 Dec 2014 11:09:22 -0800 (PST) Received: from ards-macbook-pro.local ([41.248.55.245]) by mx.google.com with ESMTPSA id t6sm24758726wjf.49.2014.12.22.11.09.18 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Dec 2014 11:09:21 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, leif.lindholm@linaro.org, roy.franz@linaro.org, mark.rutland@arm.com, catalin.marinas@arm.com, will.deacon@arm.com, matt.fleming@intel.com, bp@alien8.de, dyoung@redhat.com, msalter@redhat.com, grant.likely@linaro.org Subject: [PATCH 6/8] arm64/efi: register physmem in reserve_regions() Date: Mon, 22 Dec 2014 19:08:40 +0000 Message-Id: <1419275322-29811-7-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1419275322-29811-1-git-send-email-ard.biesheuvel@linaro.org> References: <1419275322-29811-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141222_110944_939083_92426969 X-CRM114-Status: GOOD ( 10.37 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.212.172 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.212.172 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: Ard Biesheuvel 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+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 After traversing the UEFI memory map to discover the regions that are backed by normal RAM, register the resulting minimal memory map into the physmem memblock table. Signed-off-by: Ard Biesheuvel --- arch/arm64/kernel/efi.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c index ba5fe66c3634..b1b816ecf3b3 100644 --- a/arch/arm64/kernel/efi.c +++ b/arch/arm64/kernel/efi.c @@ -155,6 +155,7 @@ static __init void reserve_regions(void) { efi_memory_desc_t *md; u64 paddr, npages, size; + struct memblock_region *r; if (uefi_debug) pr_info("Processing EFI memory map:\n"); @@ -187,6 +188,14 @@ static __init void reserve_regions(void) pr_cont("\n"); } + /* + * After memblock has stitched all the regions together, copy the + * resulting map of physical memory from the memory memblock table into + * the physmem memblock table. + */ + for_each_memblock(memory, r) + memblock_add_phys(r->base, r->size); + set_bit(EFI_MEMMAP, &efi.flags); }