From patchwork Tue Jul 24 06:57:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 10541355 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A608914BC for ; Tue, 24 Jul 2018 06:59:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 937C32873D for ; Tue, 24 Jul 2018 06:59:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8600028740; Tue, 24 Jul 2018 06:59:24 +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 316892873D for ; Tue, 24 Jul 2018 06:59:24 +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=M7HskRhvb7uKpaPyMVCFD+L3cPLioPqtP9kERY641aE=; b=afIK5GUlGBY40fI5brlrObBAkr 5ICHgLJry02LGwG1QAyrrStYmZaB7d1IwWmMYskxBcbKfC7+uiywL37u8ZHUUugIQVdqp8usYclGa qNjhOBqK70VxnZsdEKT7AbhKtfhfquc0syGp7S1YBwDzyyX//hNRwzcqONBGmDLQSkEZwdaShX//T uquyf044DjhAnfl7kILKEX2vr/zx9FxZ7Fig1nfpbMubY+Iwy5axka0Mj2Lt7oMsgj5mIfEimIFak zC72YuYBeZJbkm48jSgXC+a/wcWWOXB+gUs/RW9+rKxcFwzQSILuDRyKSXREwsNHsp2dP/REOUntk yd8hnafg==; 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 1fhrHz-0002rm-Ho; Tue, 24 Jul 2018 06:59:19 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fhrH2-0001t1-38 for linux-arm-kernel@lists.infradead.org; Tue, 24 Jul 2018 06:58:41 +0000 Received: by mail-pg1-x542.google.com with SMTP id x5-v6so2190010pgp.7 for ; Mon, 23 Jul 2018 23:58:10 -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=iV83B8R4RN0S46KhJwI/DPsWmsVjF3gQZbNOLfrDO2o=; b=C/yqdvKWveGmKVzfCDCnCkBq5NcFX9WA1yra9YOhCwvn9CfIM1fEOdK1zcjJ0ekASY p6+Ufuwksx9ALn1kqyOHJMbrBNTCPm74x4jxrdTj7H+j5bNDIqHPqIEoCE1nYZexUTJ9 EtEADpmliTcPzQlEruISMb1H0icOglJoQlEj8= 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=iV83B8R4RN0S46KhJwI/DPsWmsVjF3gQZbNOLfrDO2o=; b=twBemcZC3QDrcGqKuT/uVRGiHCR2CGXEZQj7nKi7Pmm7yKwiLgfiv7JJ9iuIBwxniZ 7sf73wcq2ADicpbRqBDH8gxM7maJ8qQ2oJNMFKQzYY7575kbObpWJdB0H87J7NAIHmLg qojXX7dtZO8MUA+Q/AB42ZNB2XfccawwWVnqgM71G1TKcCJNeXUzgwr3iwphhgYIbIZk ZmVwgciZaRqW7T9NbGHpJTfz/bZjB7Wr/A/JdbWqvJadHQvRcHO1VKDqUYBgS75nwXPv 2/4wFqfHO76cS92D+BWn3pbEnJW3tSDzSqIM+i1Obxj0D/cObwtMWjU+9edSK9f+IWLu l5MA== X-Gm-Message-State: AOUpUlF1eGY0tljJwh6JSaPDpn1ewCJ4/WLzntwxNaobAWGCFFX+sPe7 qfb3DoxWL324z26v58NSnF+S4gpPPj8= X-Google-Smtp-Source: AAOMgpcifmCLOo/grYLjGB8iAL1KUz1Ig/0vFwWtz1djsomngxlwEx01Gjj8jnGz7Fd7mWCUiPhIWg== X-Received: by 2002:a62:e00a:: with SMTP id f10-v6mr16513182pfh.208.1532415489663; Mon, 23 Jul 2018 23:58:09 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id t14-v6sm11418710pgu.0.2018.07.23.23.58.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Jul 2018 23:58: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, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com Subject: [PATCH v12 07/16] arm64: add image head flag definitions Date: Tue, 24 Jul 2018 15:57:50 +0900 Message-Id: <20180724065759.19186-8-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180724065759.19186-1-takahiro.akashi@linaro.org> References: <20180724065759.19186-1-takahiro.akashi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180723_235820_545277_09F9B6BE X-CRM114-Status: GOOD ( 12.69 ) 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.