From patchwork Tue Sep 15 15:41:18 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: 53683 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by patches.linaro.org (Postfix) with ESMTPS id 6409A22DE5 for ; Tue, 15 Sep 2015 15:42:33 +0000 (UTC) Received: by lbot4 with SMTP id t4sf9827525lbo.0 for ; Tue, 15 Sep 2015 08:42:32 -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=tnQAJfE2SvM67j5TA4sl/DzN8azZQ5kIudnSP59Ak1I=; b=TvqulrBwSznFMTEPtAfZM0sIJDlGWiH1tIeSQ/VscA5CZmjP7zq27dKTDkSMkEDzTq a6E+GE01DcMX6AlUjHNHb9facXqWh7jqaGMcaXWkYmvBlHwPlKjxJmZqD/lqe2QzgpXx NL0INomJPQ3iSrpilv5LktYGtyh9s4nqdPr5FyNrlauIegUw0qwUd1QcosvizxEZjCs3 7yYs1HABNkC/GGjULTGTGyg+cn+is5E6C4a9XXDML3impJ5/TSUXlr5IDBqe6w70+qe9 txEtUHB1Y2JtzppYhTbe7xoZfWtRJQlWCGBKisgMiIck5+FhECrcw5V0vTb9kRoAuB2c twRw== X-Gm-Message-State: ALoCoQlwXhYBWy5ARSSdBheW13LWoPlxJLBLm76pEMPAwp50ftzFOLUvBDlGcpBIVAs0YO3XbGPZ X-Received: by 10.112.57.194 with SMTP id k2mr4402178lbq.10.1442331752342; Tue, 15 Sep 2015 08:42:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.198.203 with SMTP id je11ls276570lac.9.gmail; Tue, 15 Sep 2015 08:42:32 -0700 (PDT) X-Received: by 10.152.22.73 with SMTP id b9mr22211057laf.83.1442331752184; Tue, 15 Sep 2015 08:42:32 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com. [209.85.215.51]) by mx.google.com with ESMTPS id mu6si14426743lbc.88.2015.09.15.08.42.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Sep 2015 08:42:32 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by lahg1 with SMTP id g1so81047205lah.1 for ; Tue, 15 Sep 2015 08:42:32 -0700 (PDT) X-Received: by 10.152.23.199 with SMTP id o7mr20728788laf.76.1442331752089; Tue, 15 Sep 2015 08:42:32 -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 w3csp1881955lbq; Tue, 15 Sep 2015 08:42:31 -0700 (PDT) X-Received: by 10.50.43.170 with SMTP id x10mr6965491igl.68.1442331750898; Tue, 15 Sep 2015 08:42:30 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s27si13881297ioi.17.2015.09.15.08.42.30; Tue, 15 Sep 2015 08:42:30 -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 S1753934AbbIOPm1 (ORCPT + 29 others); Tue, 15 Sep 2015 11:42:27 -0400 Received: from eu-smtp-delivery-143.mimecast.com ([146.101.78.143]:38449 "EHLO eu-smtp-delivery-143.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753544AbbIOPlp (ORCPT ); Tue, 15 Sep 2015 11:41:45 -0400 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-25-PS4C7P-YQM68UW6O8azrrw-3; Tue, 15 Sep 2015 16:41:43 +0100 Received: from e106634-lin.cambridge.arm.com ([10.1.2.79]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 15 Sep 2015 16:41:40 +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, Marc.Zyngier@arm.com, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, ard.biesheuvel@linaro.org, suzuki.poulose@arm.com Subject: [PATCH 09/15] arm64: Add page size to the kernel image header Date: Tue, 15 Sep 2015 16:41:18 +0100 Message-Id: <1442331684-28818-10-git-send-email-suzuki.poulose@arm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1442331684-28818-1-git-send-email-suzuki.poulose@arm.com> References: <1442331684-28818-1-git-send-email-suzuki.poulose@arm.com> X-OriginalArrivalTime: 15 Sep 2015 15:41:40.0968 (UTC) FILETIME=[0416C680:01D0EFCD] X-MC-Unique: PS4C7P-YQM68UW6O8azrrw-3 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.51 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 Reviewed-by: Christoffer Dall --- 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 8fae075..73b736c 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