From patchwork Wed Aug 1 07:58:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 10551899 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 D94631822 for ; Wed, 1 Aug 2018 08:53:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8B412A00D for ; Wed, 1 Aug 2018 08:53:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BBCF92B196; Wed, 1 Aug 2018 08:53:58 +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 61B182A00D for ; Wed, 1 Aug 2018 08:53:58 +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=tSxbKJQmaAdhMzTokFVisFeCqe /shwsDOH0tytyCiUNTNirnrYqJPEzyf/3fy5VCbwrEDcKa+B7sdYJN+KG0ystnopS46Ulcw0vKGuj 6pOrY5WmzD+DVwsAxUTayt9ovnOquYDZTvOGOMD4HjL3+yuVMPW5RfiMV5LX48Bog2sS+lpRtS45t uAH1DpwU5TG6Ct5+L83RDA6grbGPTBYbPPA0nXkKgBwkhTdHwZCx575b50SyKyTaijOFUOse4VGCA yFXF8VBDKqYMHrteLMVoQxEfTlfQjdJqCNc1kSEdsSIl7rNOc/p8PP5dHvkrts2R07uODWy0PQHgm Dn/+/MCQ==; 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 1fkmtF-0007uZ-7H; Wed, 01 Aug 2018 08:53:53 +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 1fkmse-00071q-Sg for linux-arm-kernel@bombadil.infradead.org; Wed, 01 Aug 2018 08:53:17 +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=iV83B8R4RN0S46KhJwI/DPsWmsVjF3gQZbNOLfrDO2o=; b=HkLOMlBNoumKbR7EJ3Qj5S8nB T/r6bfba2JHAUiqrOq+Z5kpJn9ftsQKghL2UoAIIxkLALzi7ITj2BIJchd3x4b6Rhund9QfKYNggo zRe11qlmjfkd2Jn1EOWn6/k1kLpG3+CM91jw9g2yq+Bf91oG0zeOUIWySJlxh4UeTM5gyceIn4P7c iMMy6Q+Qia19HaNAEFqotkEYZHrHtoIFSa6Wc5/drcSqsIhltuIMTay7nTrAv3/tMbZvA4s3riJcr Q7GDy7geNeHtEEvmhi5/V3xNMjnpEND67EQ6U15iM5TpJpVEBXeGKCJt+Y0MlcwwRuCOZIOOL1LLv 6RsYMIK3w==; Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fkm3i-0002Qn-UG for linux-arm-kernel@lists.infradead.org; Wed, 01 Aug 2018 08:00:45 +0000 Received: by mail-pg1-x541.google.com with SMTP id y5-v6so10425225pgv.1 for ; Wed, 01 Aug 2018 01:00: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; bh=iV83B8R4RN0S46KhJwI/DPsWmsVjF3gQZbNOLfrDO2o=; b=WXTPUSFBAaJs3u7G5trMfLp5/+9YTEExILtRGBfs+IJe9vkg2fysxPnpMbwEl9flKD lmPW2tJJl3FVwZhHhcUrzrEVaAZzqxOAZdWJl0cn+FEKabJ78upRQuMSd/7x86eFBg16 Dw+52Me8FRGDb+FHMU+dnXOEvH1CuwLqEZdy4= 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=EyyN4qCsvzVz6+fwRPYpO97El4v15XtV5nDd3Ds3K+tCH1cGcnu0kaY0GjE2vOaQ2F VwbURVD4ub21zN0oFyM4HyZ0SquYpTJyGkzsy31IhZwOyOp4codNKsRKa3Kiv4iveGSM FgLA6+q8Ry5HF+ntdsmWWSNKL/lmldc8JD8dK3WsRUHzMVpnbymx1kG0niDnl/RZNERc MQaL0shofgxIIMipWaxckCorR2GOJbqtwM7ab3Lx3hUJ80MKBjr99adidonuMYuX3xMh 3PUUIxxu7bWNx1vtLJd6xgBja9kD1UhMaTK87GQASW1+Xnio0t8M99fn+1Yp/NNCgC9e Kczg== X-Gm-Message-State: AOUpUlHydQgwRgwFjaF5+FIfgGxpAzuVIT2zKRXC4JvSJdIBLGu+Ks4G 1zNJtEuLWtFCwm85HsEuiVxWbw== X-Google-Smtp-Source: AAOMgpdobygIZm1RoETsHCSnyruo4M9KJCTqNJ6PyyDQnV/jgKCBl449ugNcQM31Q7JMVyj6ulNUXA== X-Received: by 2002:a63:ba43:: with SMTP id l3-v6mr22801896pgu.295.1533110426434; Wed, 01 Aug 2018 01:00:26 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id q78-v6sm30613415pfi.185.2018.08.01.01.00.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Aug 2018 01:00:25 -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 v13 07/16] arm64: add image head flag definitions Date: Wed, 1 Aug 2018 16:58:11 +0900 Message-Id: <20180801075820.3753-8-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180801075820.3753-1-takahiro.akashi@linaro.org> References: <20180801075820.3753-1-takahiro.akashi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180801_040039_017508_CC98EB4B X-CRM114-Status: GOOD ( 15.57 ) 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 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.