From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5] helo=mx0a-001b2d01.pphosted.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jwHpc-0006fZ-1e for kexec@lists.infradead.org; Fri, 17 Jul 2020 04:18:44 +0000 Subject: Re: [PATCH v3 06/12] ppc64/kexec_file: restrict memory usage of kdump kernel References: <159466074408.24747.10036072269371204890.stgit@hbathini.in.ibm.com> <159466091925.24747.6840028682768745598.stgit@hbathini.in.ibm.com> <87365s9ysj.fsf@morokweng.localdomain> <875zance3n.fsf@morokweng.localdomain> From: Hari Bathini Message-ID: Date: Fri, 17 Jul 2020 09:47:25 +0530 MIME-Version: 1.0 In-Reply-To: <875zance3n.fsf@morokweng.localdomain> Content-Language: en-US List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Thiago Jung Bauermann Cc: Pingfan Liu , Petr Tesarik , Nayna Jain , Kexec-ml , Mahesh J Salgaonkar , Mimi Zohar , lkml , linuxppc-dev , Sourabh Jain , Andrew Morton , Dave Young , Vivek Goyal , Eric Biederman On 17/07/20 3:33 am, Thiago Jung Bauermann wrote: > > Hari Bathini writes: > >> On 16/07/20 4:22 am, Thiago Jung Bauermann wrote: >>> >>> Hari Bathini writes: >>> >>>> + * each representing a memory range. >>>> + */ >>>> + ranges = (len >> 2) / (n_mem_addr_cells + n_mem_size_cells); >>>> + >>>> + for (i = 0; i < ranges; i++) { >>>> + base = of_read_number(prop, n_mem_addr_cells); >>>> + prop += n_mem_addr_cells; >>>> + end = base + of_read_number(prop, n_mem_size_cells) - 1; >> >> prop is not used after the above. >> >>> You need to `prop += n_mem_size_cells` here. >> >> But yeah, adding it would make it look complete in some sense.. > > Isn't it used in the next iteration of the loop? Memory@XXX/reg typically has only one range. I was looking at it from that perspective which is not right. Will update. Thanks Hari _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec