From patchwork Wed Oct 14 11:20:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suzuki K Poulose X-Patchwork-Id: 54901 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by patches.linaro.org (Postfix) with ESMTPS id 70C1420490 for ; Wed, 14 Oct 2015 11:21:52 +0000 (UTC) Received: by lbbti1 with SMTP id ti1sf24203172lbb.3 for ; Wed, 14 Oct 2015 04:21:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:content-type :content-transfer-encoding:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=8H40Wph1vXGNBw9kxJs+nWvs/qFKchG7xYOL8aRPESw=; b=PdZYZr9CEz1CDkbdpnsVvdOuzYZWQ+KWxLbyWtW0kiZkuf4KOZjHVQftNV2qn9enRY e2qzaQeMYWhPs4khG7Bz7HR6HjOy0S448kQ/OA8ALqQTc5/bwzDDOVNgu6ItavFZXYf7 meY/r5lhq1lYZI0uI1MCZ/yH67fVfRYOn6AIWuNubaDPmauvC2YklTM5MrLCJuIESzSA YrwqdaN3eB6H+puh2AUFqhzqyMJ1ulKWi/e5/g1YBuDyPpPx7YgDaXBbyyetm3nYi9qz BbjKMljRK4S7RpHva2X5eLf3r+x3dg/6iURwgk2XGRmuhrZajmv42vx5b24P4b8Qw7bf gqng== X-Gm-Message-State: ALoCoQkosK84btd0LrhvDulQJdC31SqwBLg+1JSHlFWYNZtLwbi9bu/5EDEbVz0p/C27Fy6ArzHy X-Received: by 10.112.140.202 with SMTP id ri10mr635669lbb.10.1444821710343; Wed, 14 Oct 2015 04:21:50 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.205.7 with SMTP id d7ls27341lfg.82.gmail; Wed, 14 Oct 2015 04:21:50 -0700 (PDT) X-Received: by 10.25.143.72 with SMTP id r69mr852945lfd.65.1444821710215; Wed, 14 Oct 2015 04:21:50 -0700 (PDT) Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id pd10si5207438lbc.109.2015.10.14.04.21.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Oct 2015 04:21:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by lffy185 with SMTP id y185so9601065lff.2 for ; Wed, 14 Oct 2015 04:21:50 -0700 (PDT) X-Received: by 10.25.210.206 with SMTP id j197mr861007lfg.86.1444821710000; Wed, 14 Oct 2015 04:21:50 -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.59.35 with SMTP id w3csp2667988lbq; Wed, 14 Oct 2015 04:21:48 -0700 (PDT) X-Received: by 10.50.114.166 with SMTP id jh6mr3124855igb.47.1444821706617; Wed, 14 Oct 2015 04:21:46 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 73si692596iog.153.2015.10.14.04.21.45; Wed, 14 Oct 2015 04:21:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932117AbbJNLVi (ORCPT + 30 others); Wed, 14 Oct 2015 07:21:38 -0400 Received: from eu-smtp-delivery-143.mimecast.com ([207.82.80.143]:9252 "EHLO eu-smtp-delivery-143.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753499AbbJNLVH (ORCPT ); Wed, 14 Oct 2015 07:21:07 -0400 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-18-1LTGtvSvQcuHr9ItnHfFoQ-9; Wed, 14 Oct 2015 12:21:02 +0100 Received: from e106634-lin.cambridge.arm.com ([10.1.2.79]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 14 Oct 2015 12:20:56 +0100 From: "Suzuki K. Poulose" To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, mark.rutland@arm.com, steve.capper@linaro.org, marc.zyngier@arm.com, ard.biesheuvel@linaro.org, christoffer.dall@linaro.org, "Suzuki K. Poulose" Subject: [PATCHv3 09/11] arm64: Add page size to the kernel image header Date: Wed, 14 Oct 2015 12:20:32 +0100 Message-Id: <1444821634-1689-10-git-send-email-suzuki.poulose@arm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1444821634-1689-1-git-send-email-suzuki.poulose@arm.com> References: <1444821634-1689-1-git-send-email-suzuki.poulose@arm.com> X-OriginalArrivalTime: 14 Oct 2015 11:20:56.0729 (UTC) FILETIME=[65601890:01D10672] X-MC-Unique: 1LTGtvSvQcuHr9ItnHfFoQ-9 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linux-kernel-owner@vger.kernel.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.47 as permitted sender) smtp.mailfrom=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 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Ard Biesheuvel This patch adds the page size to the arm64 kernel image header so that one can infer the PAGESIZE used by the kernel. This will be helpful to diagnose failures to boot the kernel with page size not supported by the CPU. Signed-off-by: Ard Biesheuvel Signed-off-by: Suzuki K. Poulose Acked-by: Catalin Marinas Reviewed-by: Christoffer Dall Acked-by: Mark Rutland --- Documentation/arm64/booting.txt | 7 ++++++- arch/arm64/kernel/image.h | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Documentation/arm64/booting.txt b/Documentation/arm64/booting.txt index 7d9d3c2..aaf6d77 100644 --- a/Documentation/arm64/booting.txt +++ b/Documentation/arm64/booting.txt @@ -104,7 +104,12 @@ Header notes: - The flags field (introduced in v3.17) is a little-endian 64-bit field composed as follows: Bit 0: Kernel endianness. 1 if BE, 0 if LE. - Bits 1-63: Reserved. + Bit 1-2: Kernel Page size. + 0 - Unspecified. + 1 - 4K + 2 - 16K + 3 - 64K + Bits 3-63: Reserved. - When image_size is zero, a bootloader should attempt to keep as much memory as possible free for use by the kernel immediately after the diff --git a/arch/arm64/kernel/image.h b/arch/arm64/kernel/image.h index 6eb8fee..e45759e 100644 --- a/arch/arm64/kernel/image.h +++ b/arch/arm64/kernel/image.h @@ -47,7 +47,10 @@ #define __HEAD_FLAG_BE 0 #endif -#define __HEAD_FLAGS (__HEAD_FLAG_BE << 0) +#define __HEAD_FLAG_PAGE_SIZE ((PAGE_SHIFT - 10) / 2) + +#define __HEAD_FLAGS (__HEAD_FLAG_BE << 0) | \ + (__HEAD_FLAG_PAGE_SIZE << 1) /* * These will output as part of the Image header, which should be little-endian