Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2196559imm; Mon, 16 Jul 2018 04:05:45 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfayKKhvfD08YXz8MMdTP2T0UP3B+d4hH4QYlgisQX30cPSJXJEEfL5kXNdB5xcBtxydyv0 X-Received: by 2002:a63:1a49:: with SMTP id a9-v6mr15370119pgm.423.1531739145939; Mon, 16 Jul 2018 04:05:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531739145; cv=none; d=google.com; s=arc-20160816; b=uX3jR99vcPCMYx5wN6bQt/PcbpqxXcIhcFeydX47Rx+u9xoObva1jAfjMyVwdL+4zD MdFFCbR2zL+CQR+xbYcEoauyxVzfrjQiBgcxYImHuK0yqoU7F1OxsqYiti+f90T5S19H 6gNtyeTElMcGYayX/yQWTwJQ3c/fcUdcn3n/5ARMKeQ0PRhYkdBPhXyuCiKlWZBg37yk PiAjavvNfAQibLyYpFt6LN/XyxTWAJ9TZUJ/tU4zSI9E1wQIe8d5mL8fwt7qiJAU7iP+ WvdDM9EgyQRp+N/tpnGxP8Nn7eS8VSuTmmtx5yqAg+WWfVyM++t/T3f6Sot/ITU9yMGD Gp+A== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=AU2v6QINxM7Ws8asAT0hcBXef754upPszWKxy/m+C+c=; b=af9KAOFVMmANdliQEbjTjrZQJV0JACAfxKS5cK7rHLUDh312d1Y9/GEF4pMIn9ikXz 7ynvAOrZFYroRi5xhW5/MYj4pu3HJKDJ1XxzDrehQUXkAq/JKMamBetD44RgNC8FX+87 JN7GqIMkfIWhSQqaL1v6KPnUfOpfHkbBa/PElVPfYQaSd8zcXZUQnbaimg7pWDTCzqHY dH55eY+PXKQ/TrK9d7zVuh+jloo4q4wRBtOImXCgA9ddBYUEPNFDXCe8KHoos00/TPhS ZG/uqNZFfE1av3nhUqFNv3emgBqVAnOpVDrNgBNPxKRsaA1QHCh8K1PxV5kequ744KJ6 IR9Q== 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 j10-v6si29858627plg.396.2018.07.16.04.05.31; Mon, 16 Jul 2018 04:05:45 -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 S1729583AbeGPLbI (ORCPT + 99 others); Mon, 16 Jul 2018 07:31:08 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:56968 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727953AbeGPLbI (ORCPT ); Mon, 16 Jul 2018 07:31:08 -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 7F75118A; Mon, 16 Jul 2018 04:04:14 -0700 (PDT) Received: from [10.1.206.34] (melchizedek.cambridge.arm.com [10.1.206.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7BD073F589; Mon, 16 Jul 2018 04:04:11 -0700 (PDT) Subject: Re: [PATCH v11 03/15] powerpc, kexec_file: factor out memblock-based arch_kexec_walk_mem() To: Dave Young , 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, bhe@redhat.com, arnd@arndb.de, ard.biesheuvel@linaro.org, bhsharma@redhat.com, kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "Eric W. Biederman" References: <20180711074203.3019-1-takahiro.akashi@linaro.org> <20180711074203.3019-4-takahiro.akashi@linaro.org> <20180714015223.GA2745@dhcp-128-65.nay.redhat.com> From: James Morse Message-ID: <2a4ec965-5258-5835-3022-8f403a2f6bdd@arm.com> Date: Mon, 16 Jul 2018 12:04:09 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180714015223.GA2745@dhcp-128-65.nay.redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dave, On 14/07/18 02:52, Dave Young wrote: > On 07/11/18 at 04:41pm, AKASHI Takahiro wrote: >> Memblock list is another source for usable system memory layout. >> So powerpc's arch_kexec_walk_mem() is moved to kexec_file.c so that >> other memblock-based architectures, particularly arm64, can also utilise >> it. A moved function is now renamed to kexec_walk_memblock() and merged >> into the existing arch_kexec_walk_mem() for general use, either resource >> list or memblock list. >> >> A consequent function will not work for kdump with memblock list, but >> this will be fixed in the next patch. >> diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c >> @@ -513,6 +563,10 @@ static int locate_mem_hole_callback(struct resource *res, void *arg) >> int __weak arch_kexec_walk_mem(struct kexec_buf *kbuf, >> int (*func)(struct resource *, void *)) >> { >> + if (IS_ENABLED(CONFIG_HAVE_MEMBLOCK) && >> + !IS_ENABLED(CONFIG_ARCH_DISCARD_MEMBLOCK)) >> + return kexec_walk_memblock(kbuf, func); > > AKASHI, I'm not sure if this works on all arches, for example I chekced > the .config on my Nokia N900 kernel tree, there is HAVE_MEMBLOCK=y and > no CONFIG_ARCH_DISCARD_MEMBLOCK, in 32bit arm code no arch_kexec_walk_mem() By doesn't work you mean it's a change in behaviour? I think this is fine because 32bit arm doesn't support KEXEC_FILE, (this file is kexec_file specific right?). It only affects architectures with MEMBLOCK and KEXEC_FILE: powerpc, s390 and soon arm64. s390 keeps its behaviour because it provides arch_kexec_walk_mem(), and powerpc's is copied in here as its generic 'memblock describes my memory' stuff. The implementation would be the same on arm64, so we're doing this to avoid duplicating otherwise generic arch code. I think 32bit arm should be able to use this too if it gets KEXEC_FILE support. (32bit arms' KEXEC already depends on MEMBLOCK). Thanks, James