From patchwork Fri Sep 28 06:48:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 10619055 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 33F9915A6 for ; Fri, 28 Sep 2018 06:58:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2376E2AFE0 for ; Fri, 28 Sep 2018 06:58:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 132132AFEE; Fri, 28 Sep 2018 06:58:26 +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,RCVD_IN_DNSWL_NONE 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 4B5372AFE0 for ; Fri, 28 Sep 2018 06:58:22 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=vrSBMch5A1BYJC0XTkJqn8CDrWNZKW4SO8awZo43tQY=; b=Qy+b3/wBG1G+/C b5xO+zXRdWcePFP9+U9nKo+1VgctX0Up4CLvmgKfK4Kc5qZANz6/X4lLNFsRxDPVRnk18EnKgRzNf gkltBTBT4GiIY3zZSf/ght0th1UbUhkAb0EhNDLYk8QXI91wcKrC7IlwcMB04WJ4wUNaPedqjt8j3 f87P1oq49g3oRINWFMS2JZH6onm9B5QEjynF1sDP9JJXeH0f6p481aQb8y0IzzJZ9jJhvl5CvUN2m l3dLmLNCzHvKeK6MyYUPk++JSngXsDdyxYDcn1c/SZKjV2oeaGLhejiRrrJ5oWHGPo8OfubUSIuhk X3Jh/1itBlpEjzRo41cw==; 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 1g5mjD-0003Hs-1X; Fri, 28 Sep 2018 06:58:19 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g5ma0-0004gx-QK for linux-arm-kernel@lists.infradead.org; Fri, 28 Sep 2018 06:48:51 +0000 Received: by mail-pg1-x543.google.com with SMTP id z3-v6so3720059pgv.8 for ; Thu, 27 Sep 2018 23:48:28 -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 :mime-version:content-transfer-encoding; bh=PN5LeK8svtoziSd5ZB0HR3YbxUdhrZV+lLkgGkSy5ww=; b=Sr+o5pxeVXKOqw06DTNMIn4lVoKNr0kR4J9mRDFNopsLcBVTUokarh6DZcfsqDq0QC OFUT3k1jL133SZm3xC4fX3bXuVzu2TXeJOiVSRDTXzLuLjuV+vhNHNBPSMoCQPUanvUr P7wYBet1ILkC9dYZAI7aZV24GEykbffCAJv4w= 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:mime-version:content-transfer-encoding; bh=PN5LeK8svtoziSd5ZB0HR3YbxUdhrZV+lLkgGkSy5ww=; b=NRVexTPmg7BMpiM+ramUhyBa/8PIJ3DM53ayizQs1XTcVb1L+hTugXndW9IwQbw4w3 n6Xu3t621q5yuKYterjuDejnET3NRBrP8/ZC09mV4Mm5D0AIZxdJuubDEPboDKTGgEq7 5snf9Fam2t8SCDVbQklaPiYBFR5Owe4sJRQgXB3+hrQG9zjnsniTA6cIA75txPRq3Bql yLbCKDB/QXJKS8euMMe0MrWtgBs4tdWiPvVsUJQ/6qtLo7N5BGn2P+wJHAb/mBsbczDp pi/leWaEQRngxgOWjuTo2huyKgias6YeAgDJvSwE9umrURkUjl1Ib6wutEy/bLKLITUT CX3g== X-Gm-Message-State: ABuFfojyeaWJr0YPojrG4iSqWqZgGA3agQrQp/ggzZ50Ss8zGNpfoEQ8 4N+Nc6+CBaTXWvBcULK/pq3AEg== X-Google-Smtp-Source: ACcGV62nBgWpFV+8q6H/25pGLwVOjlY7bVf20Tyu6xMawVDn02uriiocxqf19Yz2RVwaSmGyeQIiPQ== X-Received: by 2002:a17:902:c01:: with SMTP id 1-v6mr14301101pls.122.1538117307811; Thu, 27 Sep 2018 23:48:27 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id 3-v6sm6995090pfq.10.2018.09.27.23.48.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Sep 2018 23:48:26 -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 v15 07/16] arm64: add image head flag definitions Date: Fri, 28 Sep 2018 15:48:32 +0900 Message-Id: <20180928064841.14117-8-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180928064841.14117-1-takahiro.akashi@linaro.org> References: <20180928064841.14117-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180927_234848_896577_EF8B4324 X-CRM114-Status: GOOD ( 12.47 ) 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, prudo@linux.ibm.com, AKASHI Takahiro , james.morse@arm.com, linux-arm-kernel@lists.infradead.org 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.