From patchwork Fri Sep 28 06:48:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 147773 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp371225lji; Thu, 27 Sep 2018 23:48:31 -0700 (PDT) X-Google-Smtp-Source: ACcGV61x4SmLVEXu7MOXt/nt5BuoRY3muQJchjwELccyMmqSTv/YP4K/pvpL6/ivyXGM6Mkc2L2+ X-Received: by 2002:a17:902:585:: with SMTP id f5-v6mr14786573plf.7.1538117311332; Thu, 27 Sep 2018 23:48:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538117311; cv=none; d=google.com; s=arc-20160816; b=wRyhbosemTqTCzL5RntnB/0hc3sfaXU1g7Ok5UAliQaDvVa5ufxHp2Fz1LZVTM1KH3 S69U3kl9Vu9U5VoY2jdP/Jikza8uMOGC5YJMNpC0W6ejRCwV62glacp2mcZTJ9tz7WzR kIRrNAmFnN7Olj3J1H8CrAbs+i6ke8Cp2DZ5z2p9l5ZT8gglkg6LIrp5c+1rkY0gzA3E zn8jT6O0USs1f+9ILnjFUXcta6g7vXiZn0F3/Eru8fPSlBBmMWMFXIXoreObHkuzzCFl MYhyWq4tf9aAb+yMG/0LwUJ5jcIpd4EQ86Jlxo8FoS1voOJ/MaEHVB3j3LyOgRdpVAJ+ eIvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PN5LeK8svtoziSd5ZB0HR3YbxUdhrZV+lLkgGkSy5ww=; b=ethTGBJg4oYkPlsrP8uskHfdYIT5yBKIcmtrOZyZiAMLe1AGVygvlAdvRAHfPXtmSH PrxNDmF+xU/5rz16dmY7AvdzMBnPqhzNmqyPWChtXiBN9h5UDvMDY7NGrJm5K1h5akAD Gr8sgqbpcyhjbewe9f772qZVntAIScWObZMWJL80Fs3GXX6rfzZ9Al9L89zFXNiT/lFX PGAJmiCBmUwu/CcuNf42uGNT5IysxRzhCeQiUdO8fNGxVftFgfMWbWE0IwrDMtoEybHN UrgOX0L9fe9CUioeHbqbQwzMcQQAo95GMkgOx22EAtxEFHZV9lDjQKwX60A8fooOKZ/A jyBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Sr+o5pxe; 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 p12-v6si4165819pfj.244.2018.09.27.23.48.31; Thu, 27 Sep 2018 23:48:31 -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=Sr+o5pxe; 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 S1729097AbeI1NKm (ORCPT + 32 others); Fri, 28 Sep 2018 09:10:42 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:32980 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726473AbeI1NKm (ORCPT ); Fri, 28 Sep 2018 09:10:42 -0400 Received: by mail-pg1-f193.google.com with SMTP id y18-v6so3749854pge.0 for ; Thu, 27 Sep 2018 23:48:28 -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 :mime-version:content-transfer-encoding; bh=PN5LeK8svtoziSd5ZB0HR3YbxUdhrZV+lLkgGkSy5ww=; b=Sr+o5pxeVXKOqw06DTNMIn4lVoKNr0kR4J9mRDFNopsLcBVTUokarh6DZcfsqDq0QC OFUT3k1jL133SZm3xC4fX3bXuVzu2TXeJOiVSRDTXzLuLjuV+vhNHNBPSMoCQPUanvUr P7wYBet1ILkC9dYZAI7aZV24GEykbffCAJv4w= 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:mime-version:content-transfer-encoding; bh=PN5LeK8svtoziSd5ZB0HR3YbxUdhrZV+lLkgGkSy5ww=; b=BLjC/Hyui3REFugWfju7yziW7VS8319uvRgUPdZNVUa35k1o0jThRMnZKgxvwTc93W qqNkhEsTlerNElNNu5BTMxsil/X0OW2VF3UDscf+hVpJUCcfV9HANiYOCcE6vDT8g7Yd 0JkTlYTNhNfjp3bux8dk7wtjkX2FkF2TBVEaAphtJnMzqVDAjgv+QOYOgGRFHTUsXqmp dTJgmfwoBAQNz1Jl5MkI0ADr959G4aypgPndQKgOtZZkTgGH7ntfrccLKNM47JHVwEff RA51V38By/zi+n81/jeq6NvDZdcGPQyxbZpZEgvyn1dJWeXiKRPWySn7pErap2jqTlAo ouTA== X-Gm-Message-State: ABuFfojQ1Z8VS77OyNpQbCTN62Of6oMCwo06xps6ll/j9nhT0XLnjPGk rDlVDWkOjts4V9I9vlJpKjxoVQ== X-Received: by 2002:a17:902:c01:: with SMTP id 1-v6mr14301101pls.122.1538117307811; Thu, 27 Sep 2018 23:48:27 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id 3-v6sm6995090pfq.10.2018.09.27.23.48.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Sep 2018 23:48:26 -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 v15 07/16] arm64: add image head flag definitions Date: Fri, 28 Sep 2018 15:48:32 +0900 Message-Id: <20180928064841.14117-8-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180928064841.14117-1-takahiro.akashi@linaro.org> References: <20180928064841.14117-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 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.19.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.