From patchwork Fri Sep 7 08:00:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 10591853 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 DC86B5A4 for ; Fri, 7 Sep 2018 08:09:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCDFA2ADDE for ; Fri, 7 Sep 2018 08:09:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF4112ADF0; Fri, 7 Sep 2018 08:09:41 +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 48CDB2ADDE for ; Fri, 7 Sep 2018 08:09:41 +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=G6LBB3bHymLyQdt6VFqvG3YceY DaeAp+K0ydq9XF5Ax2BNjiMXdpdkE+VfHCBxlxyNl+9pTiWIMtakTx3PrFr52LR8ec/HwXsDEBkhT qPa7c2u+DL/uDdiS7p7VOPXx9P51vaNU8e75PbCnHn2noGF/KeY0fKJ5bzuGAlOqhtUEJwgS6hD+/ y1+Exz5UOKrqh5lSV8+UJMmZy4+79ApGiZlLEgKpyBCySd9/GvCWEoF9zu1uhekTX7vQiUcy7747O MoiJeY2LTaWJuyBlbrflSOtphXn8hnRZqggoZccajEddmpvEsgxptrvwOhC3vintvJz1y3Oe0Atzi K63P73Kg==; 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 1fyBpS-00072Q-EN; Fri, 07 Sep 2018 08:09:22 +0000 Received: from mail-pg1-f194.google.com ([209.85.215.194]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fyBhw-000312-3X for linux-arm-kernel@lists.infradead.org; Fri, 07 Sep 2018 08:01:40 +0000 Received: by mail-pg1-f194.google.com with SMTP id v66-v6so6583778pgb.10 for ; Fri, 07 Sep 2018 01:01:25 -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=Opb8rBToQcMZtyPYTVhVnP0kWL6jOjIeziL6TJJFv1WBRD57nZtKirw3Gv+BigdMUA IfnfHFH2jGHiprpQONf+LFBgWyM0iAdDGxdcgKTFHBWR1yJofCRZVngza0NB4IdIuVsN YatTiRLRgRL3dzahQVtG+E4EKQTPVuN5XgPMM= 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=U9gR03/CbUqtkfu2hVw5tx9qL28QdtsCqUYWaX1niUKkMeTKF93gY17y+46YFQXz5K 1QsNe5WyLVOxYQ4hKr6vMY+NHekpuhuMFNiPxYQn3dlTSpFMy8j1vMwlAYEBTj6S47GK P4VLhyStr6ukrTlCAy+sZq3tXt8bGCWh+cXVlCZ9oUUew1ekYj5i4YRVYJw+MgW6LWhY HVi7iCcoNBlneROLGCqJ1/H1YkPEOfGMd6GW80A1SQnXlJu2I3u9N2Udwm6//l/9oYz/ yNyCpJiTK+isuBe0+92SNj5C6Mio3Me8AnZwFeUEiA/gDj0rucIMW0RBOJS7QeRo4+Li +QFw== X-Gm-Message-State: APzg51BazdqfB7uINQf85O3Aq897IDyKLf7ke6lMZGJS6/nKdDKWbr9P JgzYrcsOcwcIKhq+HrtLZP3Iew== X-Google-Smtp-Source: ANB0VdZ7w/sDOgYgYrqbJwijOoX5johxlrWvhDHbfMyxIOLJzpa5P+M+GD0CUDm/69cD2d43Hic2KA== X-Received: by 2002:a62:ed5:: with SMTP id 82-v6mr7109449pfo.198.1536307224906; Fri, 07 Sep 2018 01:00:24 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id o10-v6sm7788864pgp.70.2018.09.07.01.00.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Sep 2018 01:00:24 -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 v14 07/16] arm64: add image head flag definitions Date: Fri, 7 Sep 2018 17:00:31 +0900 Message-Id: <20180907080040.4967-2-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180907080040.4967-1-takahiro.akashi@linaro.org> References: <20180907080040.4967-1-takahiro.akashi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180907_010136_176057_6581925E X-CRM114-Status: GOOD ( 12.27 ) 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.