Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4637imm; Mon, 1 Oct 2018 05:53:09 -0700 (PDT) X-Google-Smtp-Source: ACcGV63gBjhptVGsX6V2bC2XTFtZV+Kxi5UJbYibA0fJFOjmCIoA8PAXT2wX6rcOg5jwxJ4f4HMN X-Received: by 2002:a17:902:3324:: with SMTP id a33-v6mr11788631plc.208.1538398389633; Mon, 01 Oct 2018 05:53:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538398389; cv=none; d=google.com; s=arc-20160816; b=perAPS2ilOc2Yi7rrelUwVNSAu8KqVd1jX1K0i01J/FXYO/blqBcxXHN3GlHJAUQo8 aFkHMYQ7P1vhig2JAGWTCHZNN39Xzw5zOGPplNBZfNfcBhlHf6IJeiZatsAbwTVidiIi Zv/BLPV8mcNS/xDggePmnhS0+LFNiBEVEl6HUSGJIpV9NUD0RrzJe1JvUj4nu7TgENcE h8uYB/DooTekqoxEsjB8r6wH1ePSOrtu/wLpZSUT+yVUTjWjYoPZuKAkPTW/4t7x+eoZ ySnlm7V71WnbzNlIfhMD3qFKwK4rismLiryWSDcvVd/LblquDe6zjMNvfJ2m/l9pSNiQ C+8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=whNgFFabM6xMwcsujJ3mXZH2XZdT6wPSlZX5/KI3uCs=; b=wjHXg8PzOgPdRAzrMxqOkNuPk9qxLMdJ3oeaSOZdfcyI/SAvgIAn7Julek4hWYW2UZ 3LdEzlcBRyqbKPYVhAb797mkZ/4O4CM3J2eCLum5FEZ8g9GINP94Ja2TzEjX4euLeQ9r L9ZA0oPCoCQ+3RLWz5ZfODCue+NicaSK3URN95uBGsOCae1/3vUETuGC2CqwNQpGkNGm Co2JU+pb/ITpPCU77OcrdGrhkiPGP5PpVWMXCy+bELEWXOBcwtk5nB6U/2WNex8/TG6Y mT1QQUeVRua+R9zGoBugxLEhrRfQCKx7s8T/QkropH4355p23jRqQ4Qlgnr8wfrMBzSV UqmQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k6-v6si12779610pla.473.2018.10.01.05.52.54; Mon, 01 Oct 2018 05:53:09 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729449AbeJATaQ (ORCPT + 99 others); Mon, 1 Oct 2018 15:30:16 -0400 Received: from foss.arm.com ([217.140.101.70]:48304 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729204AbeJATaP (ORCPT ); Mon, 1 Oct 2018 15:30:15 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7DC4D7A9; Mon, 1 Oct 2018 05:52:34 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 485873F5A0; Mon, 1 Oct 2018 05:52:31 -0700 (PDT) Date: Mon, 1 Oct 2018 13:52:26 +0100 From: Mark Rutland To: AKASHI Takahiro Cc: 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, 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 Subject: Re: [PATCH v15 07/16] arm64: add image head flag definitions Message-ID: <20181001125225.7tlfzt5n25sckhyy@lakrids.cambridge.arm.com> References: <20180928064841.14117-1-takahiro.akashi@linaro.org> <20180928064841.14117-8-takahiro.akashi@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180928064841.14117-8-takahiro.akashi@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 28, 2018 at 03:48:32PM +0900, AKASHI Takahiro wrote: > 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 These already exist in some form in arch/arm64/kernel/image.h; can we please factor those out rather than duplicating them? I'd be happy if you'd update image.h to use the new HEAD_FLAG_* names, and removed the old definitions. > +#define HEAD_FLAG_PAGE_SIZE_4K 1 > +#define HEAD_FLAG_PAGE_SIZE_16K 2 > +#define HEAD_FLAG_PAGE_SIZE_64K 3 I appreciate these are new, since we didn't previously need definitions. Thanks, Mark. > + > +#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. > > -- > 2.19.0 >