From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4C03C2BBFD for ; Mon, 13 Apr 2020 15:57:18 +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 A83B920732 for ; Mon, 13 Apr 2020 15:57:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ssb4L0bG"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="DHKqIrFS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A83B920732 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=uNAv5eVPK1M6hGwotemZDr9e3mqDRq5zAj8e4zhbG4g=; b=ssb4L0bGmSrlVz71to3ndb7Xkm p0UVI8ciD0RlJFMf8CaMXbY85Aqw7d1tscy4ATU9S+OfJABkxia+kUDNp83BTRititG3uEmYKoQbB LgOgjdFzKVVBq4TwraTEK3VZVtR5Nsj3IBiMXkNiWj6vfszhlXU4sSFLWgaKft0FjejibZAoA5rnx 8/jCA0Jc6BsRVt8HKZ2EXWeXbtU8glN6VaB/ZJNqErlQdJ8ITgjmVBnPNCH2HSVbCR3pFuC5FtSky P+I9dhYKiXBBDBKwpXmiszoYmoEKDYOVVENAG93d8S4U5IDrr5SikQYT9e1089tJ6RG/yH47hY+FM l0Ay2Lpg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jO1SX-0000Fl-Jv; Mon, 13 Apr 2020 15:57:17 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jO1R5-0007Iq-Uq for linux-arm-kernel@lists.infradead.org; Mon, 13 Apr 2020 15:55:49 +0000 Received: from e123331-lin.home (amontpellier-657-1-18-247.w109-210.abo.wanadoo.fr [109.210.65.247]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9A9E620739; Mon, 13 Apr 2020 15:55:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586793346; bh=3Fh3BffeAc7NkYh1mfmRJ9kkzBxnlWD78shHS+Df4II=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DHKqIrFSn/z+3bCN0lXSwkvimyV3XbtswX+4+IU1uRvjArc+Aa8JphL0B5GO3vkQP BFIIrrqg3p5kdDU6FayyPB2mlYiXbpO1SWuv/ioUeLg6TdGGAsL6iXmNwIDBD6Q0ir 1QYWRWNGlPLPTMMIb5dlIdq9M67fER5jy3iOSEzk= From: Ard Biesheuvel To: linux-efi@vger.kernel.org Subject: [PATCH v2 7/8] efi/libstub/arm64: switch to ordinary page allocator for kernel image Date: Mon, 13 Apr 2020 17:55:20 +0200 Message-Id: <20200413155521.24698-8-ardb@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200413155521.24698-1-ardb@kernel.org> References: <20200413155521.24698-1-ardb@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200413_085548_085975_3A093210 X-CRM114-Status: GOOD ( 12.24 ) 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: , Cc: mark.rutland@arm.com, catalin.marinas@arm.com, nivedita@alum.mit.edu, Jonathan.Cameron@huawei.com, will@kernel.org, Ard Biesheuvel , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org It is no longer necessary to locate the kernel as low as possible in physical memory, and so we can switch from efi_low_alloc() [which is a rather nasty concoction on top of GetMemoryMap()] to a new helper called efi_allocate_pages_aligned(), which simply rounds up the size to account for the alignment, and frees the misaligned pages again. So considering that the kernel can live anywhere in the physical address space, as long as its alignment requirements are met, let's switch to efi_allocate_pages_aligned() to allocate the pages. Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/libstub/arm64-stub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/efi/libstub/arm64-stub.c b/drivers/firmware/efi/libstub/arm64-stub.c index 6fc3bd9a56db..99b67e88a33b 100644 --- a/drivers/firmware/efi/libstub/arm64-stub.c +++ b/drivers/firmware/efi/libstub/arm64-stub.c @@ -98,8 +98,8 @@ efi_status_t handle_kernel_image(unsigned long *image_addr, return EFI_SUCCESS; } - status = efi_low_alloc(*reserve_size, - min_kimg_align, reserve_addr); + status = efi_allocate_pages_aligned(*reserve_size, reserve_addr, + ULONG_MAX, min_kimg_align); if (status != EFI_SUCCESS) { pr_efi_err("Failed to relocate kernel\n"); -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel