From patchwork Wed Apr 15 15:34:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 47211 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D3B482121F for ; Wed, 15 Apr 2015 15:44:22 +0000 (UTC) Received: by laat2 with SMTP id t2sf11076842laa.2 for ; Wed, 15 Apr 2015 08:44:21 -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=dJtDmuGD+Bk9vH8pTHr5Vzmw9RYudCM5cw6qq35R6Q8=; b=ZCBgaB95Lr2YVs7gn+Tw31dZFUC7e4Nk/NpB6PDP/InwyoRWgdM+T2uEVhtyY8GNsk o11AEzfUeO8nkVVs1+ZIjhGYCWfnhkOvR+PRZXomY6/x3X7U8zvJCUF34UHAnIeCHZ51 dC4y8zN7JYL/tlYr86QPYUiWHF6V+bl1WT/LXywm9v+dh0dI4QR051QXo4BmR9fH/keL QGFEdShcIk0Zj3QLxdNN94rOsuaQ+NO/yrPC+sjeOew8VIdC4tvFo+c7NhiN1zQ8xJi+ gv107jYB5N3SRuvHbIjXFyZvvf+KZNx/6oVtyMmu91W8/MW/NvGGIwGrksArShhnUTNa BFGQ== X-Gm-Message-State: ALoCoQkdTO7kzuaE9AfKcc9tv0BJy4wXdgmqf0lr4Evdn20oaGgoPzKwiAcVrWvPBwzs/PRRBcf0 X-Received: by 10.194.241.200 with SMTP id wk8mr3927167wjc.7.1429112661770; Wed, 15 Apr 2015 08:44:21 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.178.195 with SMTP id da3ls222151lac.30.gmail; Wed, 15 Apr 2015 08:44:21 -0700 (PDT) X-Received: by 10.152.120.163 with SMTP id ld3mr24763761lab.59.1429112661610; Wed, 15 Apr 2015 08:44:21 -0700 (PDT) Received: from mail-la0-f52.google.com (mail-la0-f52.google.com. [209.85.215.52]) by mx.google.com with ESMTPS id we5si4199285lbb.30.2015.04.15.08.44.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Apr 2015 08:44:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.52 as permitted sender) client-ip=209.85.215.52; Received: by layy10 with SMTP id y10so35905989lay.0 for ; Wed, 15 Apr 2015 08:44:21 -0700 (PDT) X-Received: by 10.152.36.2 with SMTP id m2mr24083377laj.72.1429112661488; Wed, 15 Apr 2015 08:44:21 -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.67.65 with SMTP id l1csp2595240lbt; Wed, 15 Apr 2015 08:44:20 -0700 (PDT) X-Received: by 10.68.135.233 with SMTP id pv9mr47468127pbb.67.1429112659757; Wed, 15 Apr 2015 08:44:19 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id dw4si7601746pab.125.2015.04.15.08.44.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Apr 2015 08:44:19 -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 1YiPSF-0006VE-PL; Wed, 15 Apr 2015 15:42:19 +0000 Received: from mail-wg0-f47.google.com ([74.125.82.47]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YiPN2-0001Nh-6l for linux-arm-kernel@lists.infradead.org; Wed, 15 Apr 2015 15:36:56 +0000 Received: by wgsk9 with SMTP id k9so51084219wgs.3 for ; Wed, 15 Apr 2015 08:36:34 -0700 (PDT) X-Received: by 10.194.248.132 with SMTP id ym4mr4580153wjc.74.1429112194174; Wed, 15 Apr 2015 08:36:34 -0700 (PDT) Received: from ards-macbook-pro.local ([90.174.5.175]) by mx.google.com with ESMTPSA id eh5sm7674765wic.20.2015.04.15.08.36.24 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 15 Apr 2015 08:36:33 -0700 (PDT) From: Ard Biesheuvel To: mark.rutland@arm.com, catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 13/13] arm64/efi: adapt to relaxed kernel Image placement requirements Date: Wed, 15 Apr 2015 17:34:24 +0200 Message-Id: <1429112064-19952-14-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1429112064-19952-1-git-send-email-ard.biesheuvel@linaro.org> References: <1429112064-19952-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150415_083656_398165_5283A3F5 X-CRM114-Status: GOOD ( 11.01 ) 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 [74.125.82.47 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [74.125.82.47 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.215.52 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;