From patchwork Wed Jul 11 07:41:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 141672 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp4800087ljj; Wed, 11 Jul 2018 00:42:13 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdSV/pm6OrfInsA2km5T+sfj5ynY6cf/iAPQZ5hQv82GbNNirllZOKfa0cz/GhmcMuqIAoE X-Received: by 2002:a63:4763:: with SMTP id w35-v6mr25328620pgk.140.1531294933726; Wed, 11 Jul 2018 00:42:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531294933; cv=none; d=google.com; s=arc-20160816; b=yJ0IfkP9DLOOhhAbJXEw7+Ef/kN0IMeWE1v5RURmFmx6pQUzoeAsk+TdjJOzHYfE+a ffvlhZWNFI88OCfPTs1h7MsjfRdV40hIirIPMbf3SL4xthSMtqH+41yqai/N7DkTpYPa In8CPvobAXT8KGXbWzYE4Ac84auBgzwfupNRZwiDuDrNjITiC3SawCgHTV18xgNKl/zv JCinlxJXZdTEdRLxBVgBUDgEjq2ZwnbTr/pZ3sqI7+tlm9ARGBFZWRZeRAcTTGVVIPCr TnOavg4yUhgeYTClqlJzgMmY5j2Ex7+IQCqEuMjPZM7oVboEylPYxsya59VP2+m+xhsu A/7g== 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=uP6g9dIg20P4WZ2r+N/9W+9rosj1Tr0GUJ5X7xgjy0E=; b=Np8INsDLIoK5PQ/EC9PQU5aPjEoTs66RWR0cBixb9mNhHWNcocGN4RnPVSS2fX9jo1 hD9u91RrHw38DEU94Cud/WqtbBHU1Gfp5djI472rvXFYYIYd3LytIi0HfcYotL7vgSdn b4NPgtqobSgf7YD2OEp3DjHS8n8h4XGsoLDn/qEtKeCqca17Rg2UWQhrx7sg2tlTI5On Pcwd4Y4fybuduFJCZIlZZbKogt0liQSpLsMKpw1lcBH4w09lGWCKawlgqEk5hT/FQC0p ZihKPku47fMtRNvyQYi36Zggpf2nMN8VzbNEiL6k+tmHhWIWhuh4CKj6v1Vx4cocg3nO Dd0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="CajYu/jR"; 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 91-v6si18434505ply.296.2018.07.11.00.42.13; Wed, 11 Jul 2018 00:42:13 -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="CajYu/jR"; 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 S1726832AbeGKHpH (ORCPT + 22 others); Wed, 11 Jul 2018 03:45:07 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:40878 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726787AbeGKHpG (ORCPT ); Wed, 11 Jul 2018 03:45:06 -0400 Received: by mail-pl0-f66.google.com with SMTP id t6-v6so8805020plo.7 for ; Wed, 11 Jul 2018 00:42:10 -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=uP6g9dIg20P4WZ2r+N/9W+9rosj1Tr0GUJ5X7xgjy0E=; b=CajYu/jRuy62ocVoOcQvS6x6/xHOywT1GWvp13rh/8v+XGaXmUOU5lx02fGRI3BL6o aeu6X6vJBKHVAnQuZaHTLmMoc0CP4glXhbcpNZM//kb6bk+2dQOaF+n/nKanWuNV8pTC wm1gwYT8vTQ6JGYvSa9Qyd8zMS79hUz5l6Bq0= 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=uP6g9dIg20P4WZ2r+N/9W+9rosj1Tr0GUJ5X7xgjy0E=; b=mQrVTGZSFxKVKHGcVR8+CZS/ISz6tcTZ/hHVburT/2w5WBXTTscDMJgwp9EVztV6+Q /MlpY+gmNt8S1ZxMJ48ZGJSiSHO5WzmWt0gyPHVrpoI2ilMJcmnEkXIxzSGqwru+bQ57 tDUdlRPHOKQuz1F4sL1mjY9bW/6AOM1yA6GEArbh4otl2JR6+Y1aVxxoOd3pEiq6OGGi HYk7/hM3Zu8yku8d6YMvgJ/X68Fsqbe/l5BUn/Mr94/MPoNG4etXKKu9RFI006UcZzeK gH3hUGi9SmiGOADeAVljBWzXEtSv93dfQ++oKaGkjSU7wq6+4dkPhwb1gPD0eJJiNFF9 XuqA== X-Gm-Message-State: AOUpUlEn0muQ81RgeTLRvoSxmT1ATIhbs0OfVO6P/PFdghlosgC0wuZc T3LcoQarsK9lcfyIM/yZ2Jy5SA== X-Received: by 2002:a17:902:4a0c:: with SMTP id w12-v6mr485209pld.289.1531294930498; Wed, 11 Jul 2018 00:42:10 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id g124-v6sm30862281pfb.5.2018.07.11.00.42.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jul 2018 00:42:09 -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 Cc: 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 v11 06/15] arm64: add image head flag definitions Date: Wed, 11 Jul 2018 16:41:54 +0900 Message-Id: <20180711074203.3019-7-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180711074203.3019-1-takahiro.akashi@linaro.org> References: <20180711074203.3019-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.17.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.