From patchwork Mon May 11 07:13:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 48217 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 55A1F21578 for ; Mon, 11 May 2015 07:20:37 +0000 (UTC) Received: by wixv7 with SMTP id v7sf23304050wix.0 for ; Mon, 11 May 2015 00:20:36 -0700 (PDT) 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=6IeDc5BDazleOKcDULAlWud7bxKrTfjWTEBEb5VNCDA=; b=bY0KtqBADUTfeWSU9fqgqhjIaEzp0Llv9tLZpYLuVKM8lGyNmPvxzKRIMXWb8ORYIB M5ri8sD0EPqKGHPqdg6O+sE02mxojE/N2x3Gxx+JsboVbcDTYJ0/DMrW1oqknAPjcaSB xjOLnmadhoMurAKZ3bUHgG1jUocR0eWGhGLoT9Ssx7aoSVCuZYm3mlzkStFHvkZOFXU6 Artq8JSBFxV+mbnZD2Yt8h1DtZpSWvwExLgO7yXdpTvOEm2WvnUHL15aMJ5A/VsKBSE3 JYkQ1QKBB23EHInSyhkI2aTpD14yPubgV7eDMnlcbnbvffv0VxkkjZ8I7Y2GeGg4QOX/ k2rg== X-Gm-Message-State: ALoCoQnRy2VfoJmY4WK+0x067Cq1eJ1lZeImJm7n/JH1d+QtP3ogE+h4EIarj+bcmMCXo0OP9jPh X-Received: by 10.180.88.226 with SMTP id bj2mr7141446wib.7.1431328836615; Mon, 11 May 2015 00:20:36 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.115.211 with SMTP id jq19ls613898lab.69.gmail; Mon, 11 May 2015 00:20:36 -0700 (PDT) X-Received: by 10.112.35.230 with SMTP id l6mr7006739lbj.5.1431328836490; Mon, 11 May 2015 00:20:36 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id rs2si7864621lbb.106.2015.05.11.00.20.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2015 00:20:36 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by layy10 with SMTP id y10so87032226lay.0 for ; Mon, 11 May 2015 00:20:36 -0700 (PDT) X-Received: by 10.112.29.36 with SMTP id g4mr7262071lbh.56.1431328836185; Mon, 11 May 2015 00:20:36 -0700 (PDT) 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.108.230 with SMTP id hn6csp1347329lbb; Mon, 11 May 2015 00:20:35 -0700 (PDT) X-Received: by 10.66.235.200 with SMTP id uo8mr16987618pac.18.1431328834297; Mon, 11 May 2015 00:20:34 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id qy1si16826116pbc.74.2015.05.11.00.20.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2015 00:20:34 -0700 (PDT) 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 1Yrhz0-0005ZU-Oi; Mon, 11 May 2015 07:18:34 +0000 Received: from mail-wi0-f180.google.com ([209.85.212.180]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YrhuT-0000kr-Cn for linux-arm-kernel@lists.infradead.org; Mon, 11 May 2015 07:13:54 +0000 Received: by wizk4 with SMTP id k4so93529938wiz.1 for ; Mon, 11 May 2015 00:13:31 -0700 (PDT) X-Received: by 10.194.192.226 with SMTP id hj2mr17873978wjc.51.1431328411623; Mon, 11 May 2015 00:13:31 -0700 (PDT) Received: from localhost.localdomain (cag06-7-83-153-85-71.fbx.proxad.net. [83.153.85.71]) by mx.google.com with ESMTPSA id o5sm10728933wia.0.2015.05.11.00.13.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 May 2015 00:13:30 -0700 (PDT) From: Ard Biesheuvel To: catalin.marinas@arm.com, mark.rutland@arm.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH 10/10] arm64/efi: adapt to relaxed kernel Image placement requirements Date: Mon, 11 May 2015 09:13:08 +0200 Message-Id: <1431328388-3051-11-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431328388-3051-1-git-send-email-ard.biesheuvel@linaro.org> References: <1431328388-3051-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150511_001353_646293_A1F58222 X-CRM114-Status: GOOD ( 10.59 ) 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.180 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.212.180 listed in wl.mailspike.net] -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.215.54 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 This adapts the EFI stub kernel placement to the new relaxed requirements, by placing the kernel Image at the highest available 2 MB offset in physical memory. Signed-off-by: Ard Biesheuvel --- arch/arm64/kernel/efi-stub.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/efi-stub.c b/arch/arm64/kernel/efi-stub.c index f5374065ad53..60ae3324e26e 100644 --- a/arch/arm64/kernel/efi-stub.c +++ b/arch/arm64/kernel/efi-stub.c @@ -10,6 +10,7 @@ * */ #include +#include #include #include @@ -28,8 +29,8 @@ efi_status_t __init handle_kernel_image(efi_system_table_t *sys_table, kernel_size = _edata - _text; if (*image_addr != (dram_base + TEXT_OFFSET)) { kernel_memsize = kernel_size + (_end - _edata); - status = efi_low_alloc(sys_table, kernel_memsize + TEXT_OFFSET, - SZ_2M, reserve_addr); + status = efi_high_alloc(sys_table, kernel_memsize + TEXT_OFFSET, + MIN_KIMG_ALIGN, reserve_addr, ULONG_MAX); if (status != EFI_SUCCESS) { pr_efi_err(sys_table, "Failed to relocate kernel\n"); return status;