From patchwork Wed Jul 11 07:41:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 10519161 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3F99A6032A for ; Wed, 11 Jul 2018 08:53:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E96C28A04 for ; Wed, 11 Jul 2018 08:53:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 21F4428D05; Wed, 11 Jul 2018 08:53:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C15D528A04 for ; Wed, 11 Jul 2018 08:53:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=9RtdkgaUILDcMN5KnZeSO9TzdK2fBN5Y7aPmAo2w03c=; b=Op1DQwzDXh59XAuY3R4UWvomxY bLw28dQ4VLxMpH8ojYFt3Kqt6cEQYS9VM7B0rhN4PP5dfwIXMx/EVx5mtHp/9gGxtCu0LQ6f7S6Z8 7MisBv7gIancx6/DrYZe7I3Gpc3MNbyou4jlSvxKW0oFiZ5Hsk2pfeRlcFUBP4DWleBydDl6To4EW Jy43T4yLnOSzWF/MTv2IK8Nxfilsd+SyiNYRagTKTC5LCbtmBiK8r+I5iNvAPnBhtnjMxMhMhP5ik tuK9BrHIYdhRysvIBIwwrVK30l5MnDJilgeAK1JoUQFbcvvK2oauC/jdoGgZYb1TBt9Vln4DBdnuI LP9HwbfA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fdAsZ-000309-4r; Wed, 11 Jul 2018 08:53:43 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fdAsX-0002v0-N9 for linux-arm-kernel@bombadil.infradead.org; Wed, 11 Jul 2018 08:53:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=uP6g9dIg20P4WZ2r+N/9W+9rosj1Tr0GUJ5X7xgjy0E=; b=v2YMFJh3CsH7o3DhM+rouehVZ pXdfnrqPWV33aXwVwEsilN73YMdfViQa2j8y1NHRbOfTC347tOBVtM84IYrm7sF0o/xT8g0BdaxDU XNPA6niqKJTKiconGIrM7jrX5qH04BsW9gc/Waug0M5fT/rZYY4ToWtCT8h38G/8ZorOYDIyjADfD M3WQZmF0wWqNnsRt70pxk7W7vd5GZjoIuM+4UetyZL86U/ZgWFNXyrUW/1/gqxsyujvw18LeQQNge iXAO319oYCXH2bRRCC+L7DWT4HZ8V6gpk47rxpIy+oTZ/8ufnDZqXu569f5XgW29pIMxdfEn5OP99 bb+HjPBsA==; Received: from mail-pl0-x242.google.com ([2607:f8b0:400e:c01::242]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fd9lX-0004WB-4G for linux-arm-kernel@lists.infradead.org; Wed, 11 Jul 2018 07:42:25 +0000 Received: by mail-pl0-x242.google.com with SMTP id w8-v6so8806916ply.8 for ; Wed, 11 Jul 2018 00:42:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uP6g9dIg20P4WZ2r+N/9W+9rosj1Tr0GUJ5X7xgjy0E=; b=CajYu/jRuy62ocVoOcQvS6x6/xHOywT1GWvp13rh/8v+XGaXmUOU5lx02fGRI3BL6o aeu6X6vJBKHVAnQuZaHTLmMoc0CP4glXhbcpNZM//kb6bk+2dQOaF+n/nKanWuNV8pTC wm1gwYT8vTQ6JGYvSa9Qyd8zMS79hUz5l6Bq0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=uP6g9dIg20P4WZ2r+N/9W+9rosj1Tr0GUJ5X7xgjy0E=; b=qx7rzwiBxj+0WV0vbjAz1HGcU6ATrUQkP2rwsRP/qqZUKZmwWB9/t15u1byV6MMOIy hwP6dyRrqgVt09yZzKTk00i7fVUBsv2t1udMOwRejg0r2cFivaLz1LJAncwf5BgjETmo 8ELwUTQuxV3BAgSBJOJEtLqn3FkD7zlunsp+mK9g+Rbffz1OTIENY3dOhm7pL7r2PjqL fuoegR+7pEpdOBeI9Zg8lfTYtRfh0kzaINecJ4vadQhT+y1iHwbSdfdTrrTLvZJJZCkK MnUPYfYKG32p1wq4sNG4MGbmSkkBjtmUt2+SDocTjfP3ihD+8YTTb3eri/wCFfNr02Tx J1yA== X-Gm-Message-State: AOUpUlELig2gYRcCdrtzk4mZZsYLjkasT0iPu0suxGQ5dUM7s+7b5bGB M48vF+Pdd5y+XsaRt+oIM7TLlA== X-Google-Smtp-Source: AAOMgpfA+PySvSEeneX9208u9b/OSTtXBe5hsbHr4IWk8fk1elmD4NbCvPJStn5bney/lBPbrCs+7g== X-Received: by 2002:a17:902:4a0c:: with SMTP id w12-v6mr485209pld.289.1531294930498; Wed, 11 Jul 2018 00:42:10 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id g124-v6sm30862281pfb.5.2018.07.11.00.42.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jul 2018 00:42:09 -0700 (PDT) From: AKASHI Takahiro To: catalin.marinas@arm.com, will.deacon@arm.com, dhowells@redhat.com, vgoyal@redhat.com, herbert@gondor.apana.org.au, davem@davemloft.net, dyoung@redhat.com, bhe@redhat.com, arnd@arndb.de Subject: [PATCH v11 06/15] arm64: add image head flag definitions Date: Wed, 11 Jul 2018 16:41:54 +0900 Message-Id: <20180711074203.3019-7-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180711074203.3019-1-takahiro.akashi@linaro.org> References: <20180711074203.3019-1-takahiro.akashi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180711_034223_275688_E6AB87E9 X-CRM114-Status: GOOD ( 14.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ard.biesheuvel@linaro.org, bhsharma@redhat.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, AKASHI Takahiro , james.morse@arm.com, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Those image head's flags will be used later by kexec_file loader. Signed-off-by: AKASHI Takahiro Cc: Catalin Marinas Cc: Will Deacon Acked-by: James Morse --- arch/arm64/include/asm/boot.h | 15 +++++++++++++++ arch/arm64/kernel/head.S | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/boot.h b/arch/arm64/include/asm/boot.h index 355e552a9175..0bab7eed3012 100644 --- a/arch/arm64/include/asm/boot.h +++ b/arch/arm64/include/asm/boot.h @@ -5,6 +5,21 @@ #include +#define ARM64_MAGIC "ARM\x64" + +#define HEAD_FLAG_BE_SHIFT 0 +#define HEAD_FLAG_PAGE_SIZE_SHIFT 1 +#define HEAD_FLAG_BE_MASK 0x1 +#define HEAD_FLAG_PAGE_SIZE_MASK 0x3 + +#define HEAD_FLAG_BE 1 +#define HEAD_FLAG_PAGE_SIZE_4K 1 +#define HEAD_FLAG_PAGE_SIZE_16K 2 +#define HEAD_FLAG_PAGE_SIZE_64K 3 + +#define head_flag_field(flags, field) \ + (((flags) >> field##_SHIFT) & field##_MASK) + /* * arm64 requires the DTB to be 8 byte aligned and * not exceed 2MB in size. diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S index b0853069702f..8cbac6232ed1 100644 --- a/arch/arm64/kernel/head.S +++ b/arch/arm64/kernel/head.S @@ -91,7 +91,7 @@ _head: .quad 0 // reserved .quad 0 // reserved .quad 0 // reserved - .ascii "ARM\x64" // Magic number + .ascii ARM64_MAGIC // Magic number #ifdef CONFIG_EFI .long pe_header - _head // Offset to the PE header.