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: 143253 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp549380ljj; Wed, 1 Aug 2018 01:00:30 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc3oAoYyB8jWoaVbu6bO8/jr9YTnocwlsKxbamur9xpwZ02lmPNjXDuSeUWQ4fPO7BLHWST X-Received: by 2002:a17:902:3a2:: with SMTP id d31-v6mr24154394pld.287.1533110429896; Wed, 01 Aug 2018 01:00:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533110429; cv=none; d=google.com; s=arc-20160816; b=Lw3eUBX1atOKfHDePHu01oQofg05UnkV/H9FXlJZiET/+8zJVxn9OWlo2aw1YzBlWd AvCMQ9jQLmYk5sbzT/ToB0DSb6DdADxZ7EivL0GOOqbN99yREonRVAam6nSSR17X7X9i K/xtM3Nd8XqOTc+LuE35WXofrOIhSAveDVcAjQuIQelWxCjzPKdp7G81fWCrE6L8Ayi2 TPNtpKwf26lIYtgXtuHjdDAcYPDtvZsydjZepGZ3Joj0+dD5xi2dc8uBomgewf9A3WC1 QUXF9XuKHjkQex77ANetTFN6KviNg8+tZJd0yXLrzgW0dci6dOhtQF6uZ0AK7c2pXwKo 2fOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=iV83B8R4RN0S46KhJwI/DPsWmsVjF3gQZbNOLfrDO2o=; b=yWnxUt6YTTgqds7/BbMSkurU8hPYwXA8vJ7uiSRqWJJIgiWoTgclY8/YfrUzHREvIK DfS2Ejut1VYK/R4xehJVQ52sCrxvIdFu4DMJbCJOOiuv566gF3IBuNSzdhajxjPe1XMt I8BQiRUi/pE9f3hz9NrSGGRYety7+/k26H3KoBsYSbGmfj2ie0tX/xSXGhHAD+0GzQxD McLLFjFNYzKpjiO0L3fviaHnvEjuO+DHsfwiofcc0+RoeuLCmG7yWY5e63WBhVuQIxQE UX4/22QTsteFdw9wr2AfEGOrmV/rM2I31XrQ0KneVPREv0aU9sekTmrhyO5/jhrP/DHu oGQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WXTPUSFB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q27-v6si15963999pgk.187.2018.08.01.01.00.29; Wed, 01 Aug 2018 01:00:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WXTPUSFB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388175AbeHAJox (ORCPT + 31 others); Wed, 1 Aug 2018 05:44:53 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:35387 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387647AbeHAJow (ORCPT ); Wed, 1 Aug 2018 05:44:52 -0400 Received: by mail-pg1-f196.google.com with SMTP id e6-v6so10420376pgv.2 for ; Wed, 01 Aug 2018 01:00:26 -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=ncauYQQW7DJnUCfL35DFnpO+5F1bTRkDMrT+M24qR2d4MGOfUXaL1XmsgnTA2bk1I/ nHXvd73uj5DKMWD8CPt5xWuV7VL9YFVKbHmIPeVfB7XnAkj8ICMW5hSfvWisi0SZh2Hj Lzw40wTxVc6sp+W3EsdnAU9qi7y0U/oBGz2xTf8FvuFQgUGjT98u0ifhC6bIr2nQO/H6 5d/Zw5CCUFd8sJVWqRvKX5FEtT/bew50IUkxyADQDMbArRQD/lMvr+YPRdqAOSPzx+J+ gIUoA3de6mhUFFi/igZJa4d2/KvIOQeErUl+l1HAG+Gc+any2ZrfQ2fFd8vcq4aD2STm IMRQ== X-Gm-Message-State: AOUpUlENhhvKwz+CECnXDv03BbNCRwqjon46aspzJh6sMlmMJbCd/pN8 NKrqaAQ9xyILoycoVnWjeqo/jg== 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 Cc: prudo@linux.ibm.com, ard.biesheuvel@linaro.org, james.morse@arm.com, bhsharma@redhat.com, kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, AKASHI Takahiro 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.18.0 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.