Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3390081ybt; Tue, 30 Jun 2020 01:17:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLVFfCrJQ7Bnuf9CHOsJDv5FFVWcKT/abmW7JGfln0xDEQeTXNyf05IHF8vrHJ+exZcURY X-Received: by 2002:a05:6402:318d:: with SMTP id di13mr10156876edb.172.1593505075738; Tue, 30 Jun 2020 01:17:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593505075; cv=none; d=google.com; s=arc-20160816; b=gYwZBpCPPdLChxjjsTRBZzK4mczepJRMLhvpWwRHoQMAKwxosjb/CqyRdcVAEQgPZ5 2AbNGDBGgHjmUifk4k25On8dxRKIoNC0WWP8SqzlTwKxvRyjPzNdvFCoaz2IY22WBkb6 ygQXhgdZh4bp0jCXgj48UXDsIB1si3vqoO7YZb8mfHkKVTeTsKxatpS3weTQuFoxAsqM 50RtD1MJW/TwZ5t6j6gycxUb0FRRNjCt1xyp4tIr8UnTytpXodsqscQ73+NY4M+PnFlv FYwrhYppaBznvJuWSU0myVOtRed6PUYHizzUIPNr9ZjhiyZrkvIbtdDiNu4Sw8ulqXgf kQ1w== 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:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:dkim-signature; bh=HTOMqbVijE1+7ERZjjkGYdaILglmW0FhOih0WPQ8e80=; b=KvnbJUbTOXjY1mTDZ/BEaT9sCBGKcGz/Eqy82qE1N3bptLPl0oYw7Kmq2A4sX1zHrH pDqDSmSXCZ6ncwa4kmJgtEhYt3RCGVrzFVyZIpuD3gEZ6hlQXehcTL8Zne1X8Ci8nqdD //UoESuyZMGRCAnqp2O+Aazxd4DoCWsxgEZpEQpMAD7PALDies6YTOm9PijEAfXSJxQf MLg/vu1EcDH9vF6ztawBcFSnS/+OVQxstm94g6sVb6FMV+0Vr2eS2r24nKmXTkxFK0b8 Jh2wWIiMbgnbRl2sgul7QD6ZFej3KDaybM0+BYL43BtU5ZrSXav2LNHd8udLRcNNzt7+ RXgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RywBO01n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a14si1263119ejv.483.2020.06.30.01.17.31; Tue, 30 Jun 2020 01:17:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=RywBO01n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730861AbgF3INb (ORCPT + 99 others); Tue, 30 Jun 2020 04:13:31 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:36199 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730819AbgF3INa (ORCPT ); Tue, 30 Jun 2020 04:13:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593504807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HTOMqbVijE1+7ERZjjkGYdaILglmW0FhOih0WPQ8e80=; b=RywBO01nL0CIckFNAIB68gFt+DpMv5FchC4G59rXr7HN4jplcMzqDqbZL19utVDNDFdK1z vhLPiUyF0nt2MhZL9Pd1ayx1rG6hO3AtSkwQB2hlvw6jqCYz068zHTkKorbesGp4l+8t83 gdWdGYsnGOG4RkzIoliBnrOryyqQwW0= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-452-loft5Z2bOUSG5zxBFP8RYQ-1; Tue, 30 Jun 2020 04:13:17 -0400 X-MC-Unique: loft5Z2bOUSG5zxBFP8RYQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C44311883623; Tue, 30 Jun 2020 08:13:15 +0000 (UTC) Received: from [10.72.8.19] (ovpn-8-19.pek2.redhat.com [10.72.8.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7197860BF3; Tue, 30 Jun 2020 08:13:07 +0000 (UTC) Subject: Re: [PATCH 04/11] ppc64/kexec_file: avoid stomping memory used by special regions To: Hari Bathini , Michael Ellerman , Andrew Morton References: <159319825403.16351.7253978047621755765.stgit@hbathini.in.ibm.com> <159319831192.16351.17443438699302756548.stgit@hbathini.in.ibm.com> <9cfda789-0747-a67a-b825-5ea6f15099b8@redhat.com> <283fc181-2331-7c2f-db66-5e02e5ffb2e4@redhat.com> Cc: Kexec-ml , Petr Tesarik , Mahesh J Salgaonkar , Sourabh Jain , lkml , linuxppc-dev , Mimi Zohar , Vivek Goyal , Dave Young , Thiago Jung Bauermann , Eric Biederman From: piliu Message-ID: Date: Tue, 30 Jun 2020 16:13:04 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/30/2020 02:10 PM, Hari Bathini wrote: > > > On 30/06/20 9:00 am, piliu wrote: >> >> >> On 06/29/2020 01:55 PM, Hari Bathini wrote: >>> >>> >>> On 28/06/20 7:44 am, piliu wrote: >>>> Hi Hari, >>> >>> Hi Pingfan, >>> >>>> >>>> After a quick through for this series, I have a few question/comment on >>>> this patch for the time being. Pls see comment inline. >>>> >>>> On 06/27/2020 03:05 AM, Hari Bathini wrote: >>>>> crashkernel region could have an overlap with special memory regions >>>>> like opal, rtas, tce-table & such. These regions are referred to as >>>>> exclude memory ranges. Setup this ranges during image probe in order >>>>> to avoid them while finding the buffer for different kdump segments. >>> >>> [...] >>> >>>>> + /* >>>>> + * Use the locate_mem_hole logic in kexec_add_buffer() for regular >>>>> + * kexec_file_load syscall >>>>> + */ >>>>> + if (kbuf->image->type != KEXEC_TYPE_CRASH) >>>>> + return 0; >>>> Can the ranges overlap [crashk_res.start, crashk_res.end]? Otherwise >>>> there is no requirement for @exclude_ranges. >>> >>> The ranges like rtas, opal are loaded by f/w. They almost always overlap with >>> crashkernel region. So, @exclude_ranges is required to support kdump. >> f/w passes rtas/opal as service, then must f/w mark these ranges as >> fdt_reserved_mem in order to make kernel aware not to use these ranges? > > It does. Actually, reserve_map + reserved-ranges are reserved as soon as > memblock allocator is ready but not before crashkernel reservation. > Check early_reserve_mem() call in kernel/prom.c > >> Otherwise kernel memory allocation besides kdump can also overwrite >> these ranges.> >> Hmm, revisiting reserve_crashkernel(). It seems not to take any reserved >> memory into consider except kernel text. Could it work based on memblock >> allocator? > > So, kdump could possibly overwrite these regions which is why an exclude > range list is needed. Same thing was done in kexec-tools as well. OK, got it. Thanks, Pingfan > > Thanks > Hari > > _______________________________________________ > kexec mailing list > kexec@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/kexec >