Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp943552imm; Mon, 1 Oct 2018 23:19:28 -0700 (PDT) X-Google-Smtp-Source: ACcGV63QAGz94EVtvJjZ+jHUxWc0PvQdgU+xnJZLignSm447s9nlupohaXHGCmMsEAyn+hIdvgYj X-Received: by 2002:a17:902:e185:: with SMTP id cd5-v6mr14885249plb.224.1538461168452; Mon, 01 Oct 2018 23:19:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538461168; cv=none; d=google.com; s=arc-20160816; b=BQhn7e3bSLp4ROmYqPvPjMuWSKDgASLThQhid9qRbQYuyRvxiM8YvNo7603omijwHB FPnGX1Y3z5pRbB1/KoUE/Q4LJienzneKQBWY7RsbSM8Xd9UYiFLazTHTh1pOzek3z1wJ KwHOraiKPCwYE9E9mslf10Ajnn8h4/hllBYRIpTkpM8FuNCxywGaUXMWDtxMLVU8/ZWU PZ1s+1HOfB63WO27xEFJ+k344YS7KfpXt4JWQl8pe0EzNDH/TkXkggaeSXs8ci2On6yA Aruh1x6nBcrkqnOGCeDocBT8TQEUfOT7tXJldpx7ZVedNhHcxlynlq+qHxGo06QNzSz9 4hrw== 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:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=vBC16zRhhpl/FWMvNay4Y6NFeKxR+UjhwN37peUPwN8=; b=I2M1Hy6OKEeMdmOQnBmEpaWyCfgyuw1bHzAqMRCnuO/VRp3tAu2OsLrS9ZXLP2Rm6F leHUOm7Y6wniomYLKoPCC7Jy1B9OfVdcv34tTRjR1u/jPfDieyFP1D0Ziw6i/QVwPJv5 JaiwMNJtoBHli1DRbyBC+FtDddDhrXaJxscnfPDwUW4YsNVIkaTslg6PUIRkilpQVa4d B7DH9aWLMD0nT26jUUHXpzf8+ZVmSUVasvOKtJuIfCeSIZODqDHisrYVH2eUaPQQo7T4 jbSjZY0OgjfSqkpbXJ5NvOomGyQhHvv0F5CL0aFpj7/CNcauaw62GLl7XqA3MUhBs8fY rTAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NrH8PIBf; 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 33-v6si13823207plh.50.2018.10.01.23.19.14; Mon, 01 Oct 2018 23:19:28 -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=NrH8PIBf; 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 S1726565AbeJBNAa (ORCPT + 99 others); Tue, 2 Oct 2018 09:00:30 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:46964 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726481AbeJBNAa (ORCPT ); Tue, 2 Oct 2018 09:00:30 -0400 Received: by mail-pl1-f193.google.com with SMTP id v5-v6so127665plz.13 for ; Mon, 01 Oct 2018 23:18:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=vBC16zRhhpl/FWMvNay4Y6NFeKxR+UjhwN37peUPwN8=; b=NrH8PIBfj8N3SMjBhqBFB0PX1Ca9J1TTJvby/iyhlqH7Mrwxymp2SlvqhlrtwQNKUp FwUSaSI7jpIFPUG1iZWzBN6vMubOSTHDbFU6+T9Q665XkmCcWcqGgZKiB8p+y4tI8SJ7 iGBdLXqea8M8562Kny1jEKhnPfuUx+pwy4NUc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=vBC16zRhhpl/FWMvNay4Y6NFeKxR+UjhwN37peUPwN8=; b=tDjLbi6JOW1smXQSOCu6OZhMTp4pg4eazum+cxy5aNBv/Hf33FUuX4BPBU1UH/3aeW mkg8gU2I7E4JF2gt0fWZ7WBoHcbnGIV/AycOEGQh2TVuFNObC9eFfamS1cCnEMzXiXFl Xg9t2nmbEqibNPWsDeUvBhf8GiX30xx7M73/i9g0R0Rh+fwarnBipvMszk+hzwkGC5aA 9J6ZHddEvar21dDcrKVNiJucJ3JVdQPPRgGtbHWr+Fu5oJarPhTj0Rdy71NHmzPfhkpW 9bUaZV52ZC5ateuse4ryawcC0FA7MimzdD2ZuOTC4kppWEL+3RtXN35OfcWWYL/0veAj pv7Q== X-Gm-Message-State: ABuFfoi5l+TwfEqdF+5SXO9jAZUz3ZE+5GtW8sV2fZWBKH9bbyYz2l6A JPKWGLEpehyY7ZrX9bg/LdcYzzyKtL0= X-Received: by 2002:a63:6a42:: with SMTP id f63-v6mr13512354pgc.48.1538461136445; Mon, 01 Oct 2018 23:18:56 -0700 (PDT) Received: from linaro.org ([121.95.100.191]) by smtp.googlemail.com with ESMTPSA id q26-v6sm22912185pfj.127.2018.10.01.23.18.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Oct 2018 23:18:55 -0700 (PDT) Date: Tue, 2 Oct 2018 15:20:23 +0900 From: AKASHI Takahiro To: Dave Young 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, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, ard.biesheuvel@linaro.org, bhsharma@redhat.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, prudo@linux.ibm.com, james.morse@arm.com, "Eric W. Biederman" , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v15 04/16] powerpc, kexec_file: factor out memblock-based arch_kexec_walk_mem() Message-ID: <20181002062021.GE32578@linaro.org> Mail-Followup-To: AKASHI Takahiro , Dave Young , 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, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, ard.biesheuvel@linaro.org, bhsharma@redhat.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, prudo@linux.ibm.com, james.morse@arm.com, "Eric W. Biederman" , linux-arm-kernel@lists.infradead.org References: <20180928064841.14117-1-takahiro.akashi@linaro.org> <20180928064841.14117-5-takahiro.akashi@linaro.org> <20180930100834.GD6950@dhcp-128-65.nay.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180930100834.GD6950@dhcp-128-65.nay.redhat.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 30, 2018 at 06:08:34PM +0800, Dave Young wrote: > Hi AKASHI, > > On 09/28/18 at 03:48pm, AKASHI Takahiro wrote: > > Memblock list is another source for usable system memory layout. > > So move powerpc's arch_kexec_walk_mem() to common code so that other > > memblock-based architectures, particularly arm64, can also utilise it. > > A moved function is now renamed to kexec_walk_memblock() and integrated > > into kexec_locate_mem_hole(), which will now be usable for all > > architectures with no need for overriding arch_kexec_walk_mem(). > > > > With this change, arch_kexec_walk_mem() need no longer be a weak function, > > and was now renamed to kexec_walk_resources(). > > > > Since powerpc doesn't support kdump in its kexec_file_load(), the current > > kexec_walk_memblock() won't work for kdump either in this form, this will > > be fixed in the next patch. > > > > Signed-off-by: AKASHI Takahiro > > Cc: "Eric W. Biederman" > > Acked-by: Dave Young > > Cc: Vivek Goyal > > Cc: Baoquan He > > Acked-by: James Morse > > [snip] > > > + > > /** > > * arch_kexec_walk_mem - call func(data) on free memory regions > > The function name should be updated as well. Ah, thank you. -Takahiro Akashi > > * @kbuf: Context info for the search. Also passed to @func. > > @@ -510,8 +560,8 @@ static int locate_mem_hole_callback(struct resource *res, void *arg) > > * and that value will be returned. If all free regions are visited without > > * func returning non-zero, then zero will be returned. > > */ > > -int __weak arch_kexec_walk_mem(struct kexec_buf *kbuf, > > - int (*func)(struct resource *, void *)) > > +static int kexec_walk_resources(struct kexec_buf *kbuf, > > + int (*func)(struct resource *, void *)) > > { > > if (kbuf->image->type == KEXEC_TYPE_CRASH) > > return walk_iomem_res_desc(crashk_res.desc, > > @@ -538,7 +588,11 @@ int kexec_locate_mem_hole(struct kexec_buf *kbuf) > > if (kbuf->mem != KEXEC_BUF_MEM_UNKNOWN) > > return 0; > > > > - ret = arch_kexec_walk_mem(kbuf, locate_mem_hole_callback); > > + if (IS_ENABLED(CONFIG_HAVE_MEMBLOCK) && > > + !IS_ENABLED(CONFIG_ARCH_DISCARD_MEMBLOCK)) > > + ret = kexec_walk_memblock(kbuf, locate_mem_hole_callback); > > + else > > + ret = kexec_walk_resources(kbuf, locate_mem_hole_callback); > > > > return ret == 1 ? 0 : -EADDRNOTAVAIL; > > } > > -- > > 2.19.0 > > > > Thanks > Dave