From patchwork Sat Jun 23 02:20:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 10483431 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 EE66760532 for ; Sat, 23 Jun 2018 02:23:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC58428E23 for ; Sat, 23 Jun 2018 02:23:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0F5A28E27; Sat, 23 Jun 2018 02:23:39 +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 69D6428E23 for ; Sat, 23 Jun 2018 02:23:39 +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=QxHnt5r1V7cxjKIVJGFbMCoeOg2mSdNjTOiA8znjCZA=; b=BlFppcW7N4P7xHOLS3E886AiTC DF3B/thtguYMMO7Odd0TsPh/jRkxfLFkCwK8jcNxapUb9Sx395e5zDkCJE5vitcnPwehT6KT5YRoA AHnR8Z0dN4el/lg3ew14KCItWmpdMsP4eVo37fQVVizrv6O9z03qhF7adCB9Ol5qRoGVxk/hCDgeP PQ2gd/F9rSYtI87X0DDO74rgpOXDHJoWfijbQ1GrTfchdv4x46DgfT+AdAdV+ka99K+NFwoqBVhXP H7c+aEQ1JW7BxsA4dTC6t080iNmhC5bdi66AZNhmN7djHwyBxaEX5keXMVjp3lY7dXqvszGGKaz6u BafR9HtA==; 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 1fWYD9-0004sD-Lh; Sat, 23 Jun 2018 02:23:35 +0000 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fWYB4-0003Po-3g for linux-arm-kernel@lists.infradead.org; Sat, 23 Jun 2018 02:21:49 +0000 Received: by mail-pf0-x243.google.com with SMTP id q1-v6so3989905pff.13 for ; Fri, 22 Jun 2018 19:21:15 -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=N6l5ADvfSARlBrFBLh9//Q8Y5HUEl/bDth4c/brQGkk=; b=WxlURdmDbAsopckzPs87JfrpO7YFHsw+qidS6gzFHAF8brPet5F1uzoQQJiEotUoCv DYJni3FAh3r4za3XeLOeDQTtUi1TZ7nU14JjW1mZk9959O6lBg8dN8jlc10GBcLYCJts lNgW9L2z95O5KO2wF+miWm97uNUn8cVfC1URE= 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=N6l5ADvfSARlBrFBLh9//Q8Y5HUEl/bDth4c/brQGkk=; b=gnfUWOQ6kOOPPcTnnQdyHEPyFUwQxDV8sC2Rc59tdiVPHqG9ZpXxaRucqSV8XP5MSS FMZbgktY80MCCtTz+EFuZiFwklsHsztwN5NyDs0s2ZvazD9YvfL9pToHhi460CbBxIrw RbxiNNhPIzPXQ0rbHjlimshTLpDd5+wqJsMp/lerBL+arHzQ49G2HvxZNjB4yfbC11ho v4hv6icGg3ci4H8Ik+nKiAQMlAPVFG9MVFe5QWrweGkrs8SmKW4tF1IDm27wv+A4Tbg4 TrMRX1A5TcLQ7BIScN7wVC+2quMjBpAvVU+2sxolzxxu/LHI9J2jemO4Z3F3GNnNXVNi rIIw== X-Gm-Message-State: APt69E0KomBARnkeBqLbiuLaUiiLfC0GtYEhfpeNJ9R8wfFg2z7bEk41 HV5vgptDVS5jqmcmUIP7WsolfA== X-Google-Smtp-Source: ADUXVKJ1V2XQzWKskz/YDEm8bb9Xn6Z0Xo5ofbNPfvTCrThKco+gZSj6uXmegiP43FW6dgcmvdS9QA== X-Received: by 2002:a65:468e:: with SMTP id h14-v6mr3245878pgr.89.1529720474766; Fri, 22 Jun 2018 19:21:14 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id a8-v6sm17553197pfe.72.2018.06.22.19.21.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jun 2018 19:21:14 -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 v10 05/14] arm64: add image head flag definitions Date: Sat, 23 Jun 2018 11:20:49 +0900 Message-Id: <20180623022058.10935-6-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180623022058.10935-1-takahiro.akashi@linaro.org> References: <20180623022058.10935-1-takahiro.akashi@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180622_192126_175897_6E7BADD9 X-CRM114-Status: GOOD ( 11.70 ) 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.