From patchwork Fri May 22 05:43:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 48886 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id EF3D621411 for ; Fri, 22 May 2015 05:47:09 +0000 (UTC) Received: by lagv1 with SMTP id v1sf2193072lag.1 for ; Thu, 21 May 2015 22:47:08 -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=gkf3ckR8JPenM/DH8rChPGXlIMW3MqALQ6y1fQJBRIQ=; b=gPcXqNoPx9/bUBk4/Zc2NxSvFJDamrYU9aH43jzCEU3bzWXrJNjuvDhaCJihILVmkR 9ccajBHMH8kp97SDQIkQObZvmHNipSDMayTCbjlHf/oc8yemwLoDzuydvTeF1cL6yN+i THqkQ3IZsnwnboW2uFyElVZnI1aKnVvI4NYP1j83sOup0ILt4P3NpyY1GyNCouv1Ahla bh8fhp5/tsDtuZJbvWiNix+gTIYnDUDV/bMyUV8nyur3xK8eARYxL8wmq/LzUQp0u+h4 zXEQgq+o7eSbroU/INKFb7llMG4HdE52Qiz0cPqhMJ7neLXM4hnWabXiB5QUh4AbtLU4 H0SQ== X-Gm-Message-State: ALoCoQn3LizF/jjWZ+JryIPDzZWLMF9EahIZJlUQEbJ8iBir0RIRzm9WtslO4uHZHvW7bH1RJ3+Q X-Received: by 10.180.10.136 with SMTP id i8mr2378443wib.7.1432273628438; Thu, 21 May 2015 22:47:08 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.101 with SMTP id r5ls413758lar.78.gmail; Thu, 21 May 2015 22:47:08 -0700 (PDT) X-Received: by 10.112.134.167 with SMTP id pl7mr4993500lbb.50.1432273628271; Thu, 21 May 2015 22:47:08 -0700 (PDT) Received: from mail-la0-f48.google.com (mail-la0-f48.google.com. [209.85.215.48]) by mx.google.com with ESMTPS id yj8si712972lab.53.2015.05.21.22.47.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 May 2015 22:47:08 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.48 as permitted sender) client-ip=209.85.215.48; Received: by lami4 with SMTP id i4so5442528lam.0 for ; Thu, 21 May 2015 22:47:08 -0700 (PDT) X-Received: by 10.152.4.72 with SMTP id i8mr5172989lai.32.1432273628173; Thu, 21 May 2015 22:47:08 -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 hn6csp1099862lbb; Thu, 21 May 2015 22:47:07 -0700 (PDT) X-Received: by 10.70.54.103 with SMTP id i7mr12593261pdp.134.1432273626248; Thu, 21 May 2015 22:47:06 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id om4si1759979pdb.237.2015.05.21.22.47.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 May 2015 22:47:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) 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 1YvfmA-00078D-QW; Fri, 22 May 2015 05:45:42 +0000 Received: from mail-pa0-f46.google.com ([209.85.220.46]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yvfm4-0006tu-Ob for linux-arm-kernel@lists.infradead.org; Fri, 22 May 2015 05:45:38 +0000 Received: by pacwv17 with SMTP id wv17so10669338pac.2 for ; Thu, 21 May 2015 22:45:13 -0700 (PDT) X-Received: by 10.67.3.3 with SMTP id bs3mr12376577pad.51.1432273512946; Thu, 21 May 2015 22:45:12 -0700 (PDT) Received: from localhost.localdomain (61-205-7-87m5.grp1.mineo.jp. [61.205.7.87]) by mx.google.com with ESMTPSA id pc9sm843249pdb.6.2015.05.21.22.45.09 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 May 2015 22:45:11 -0700 (PDT) From: AKASHI Takahiro To: ard.biesheuvel@linaro.org Subject: [PATCH] fixup! arm64: allow kernel Image to be loaded anywhere in physical memory Date: Fri, 22 May 2015 14:43:07 +0900 Message-Id: <1432273387-7385-1-git-send-email-takahiro.akashi@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-20150521_224536_846858_912D1F2F X-CRM114-Status: GOOD ( 11.71 ) 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.220.46 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.220.46 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: mark.rutland@arm.com, catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org, AKASHI Takahiro 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: takahiro.akashi@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.48 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 Ard, In testing my kexec/dump code, I found that your patch doesn't work with initrd. Since the virtual addresses of initrd are calc'ed earlier than map_mem(), they have bogus values and unpack_to_rootfs() will fail. This patch fixes the issue. Please think of taking it in your next version. --- arch/arm64/mm/mmu.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 7e3e6af..43c2317 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -452,6 +453,13 @@ static void __init map_mem(void) bootstrap_linear_mapping(new_va_offset); kernel_va_offset = new_va_offset; + + /* Recalculate virtual addresses of initrd region */ + if (initrd_start) { + initrd_start += new_va_offset; + initrd_end += new_va_offset; + } + memstart_addr = new_memstart_addr; /* map all the memory banks */