Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2969358ybt; Mon, 29 Jun 2020 11:44:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbBAu+VV2/gwBsM773qisMUZsD4C8xQRzXox3OTHLQsYQVOrkDD/ySKCYrUxnC2UE2CicY X-Received: by 2002:a50:d790:: with SMTP id w16mr18410530edi.231.1593456283888; Mon, 29 Jun 2020 11:44:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593456283; cv=none; d=google.com; s=arc-20160816; b=kcXoIYCqpEhLOAHg0QaoivV5eT2QzoQTFVY31AcSItVcPy5VVc+24VdxXZNlNQQ8tJ Vvp6drwV2vxRkMD1XeAuWQKEdYPQR9lx9VrdbUXhEiLOc0YuXUthAv2K8cDNjSg75nOS 9eczxXZaLk3L3eDMINEXRjTUvEl6PZTP7S21Vn728SPWs6Ho4dmOAFwUK1iFmOnp8UAF Da3s8IgUClpgSgsNnNi590xxNExmdzQEq4BuDWq5nLRzwTfpnxksGUBxM736MDN5xLnT dtmRTuGQe2b/FTrl8/Xsl0q52X6L2uULK5ddnp30W/CsK5vFOxA80pBtBrbU0UDbisgX R+Zg== 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; bh=74wptGQCjYkS9/vJqrhI5gUfKKYj0F1LGjal2wsxqvw=; b=oYeUdWE+ZCKT0zFXsK8Bz+Y1nWNlz1S5vluPLzYQ0OZcA3ZCNNDSy7va4R2KHyCMGf y1Lmy85FZmaXW38DYjnMuGOXiRFhb7S6hyX7ANWjUyXpOTsLoBLXU+xWijUzl4ZES3QH Xg/x4yFqTy/h8In8B7zhqAYzPZO4s8+WTrMSxpfrU7TWWqfQiQhOrCZLQ8Tb+wvDHjpe 07vFTW455KDkYyvl1xgRtpx55uIKw1JJe8G+YSoEQzuqpAqS9HJZpSE6I8pUQABgdO7Q fAnPa5n3T6AIg96vXVmNxjr+xo1MrWIthi75q9ecl2SfeKmh4/Xg/EVDMbfl0T+ZxB0s Db/Q== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h2si276505ejp.405.2020.06.29.11.44.20; Mon, 29 Jun 2020 11:44:43 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729135AbgF2SoL (ORCPT + 99 others); Mon, 29 Jun 2020 14:44:11 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:58154 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728053AbgF2Snz (ORCPT ); Mon, 29 Jun 2020 14:43:55 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 05T5WiRG147333; Mon, 29 Jun 2020 01:55:11 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 31x20gnhs9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 29 Jun 2020 01:55:11 -0400 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 05T5oYa8004436; Mon, 29 Jun 2020 01:55:11 -0400 Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com with ESMTP id 31x20gnhre-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 29 Jun 2020 01:55:10 -0400 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 05T5oNoe025934; Mon, 29 Jun 2020 05:55:09 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma01fra.de.ibm.com with ESMTP id 31wyyas0wp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 29 Jun 2020 05:55:08 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 05T5t6hY29098208 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 29 Jun 2020 05:55:06 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 148CAA404D; Mon, 29 Jun 2020 05:55:06 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 246A1A4040; Mon, 29 Jun 2020 05:55:03 +0000 (GMT) Received: from [9.102.0.109] (unknown [9.102.0.109]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 29 Jun 2020 05:55:02 +0000 (GMT) Subject: Re: [PATCH 04/11] ppc64/kexec_file: avoid stomping memory used by special regions To: piliu , Michael Ellerman , Andrew Morton Cc: Kexec-ml , Petr Tesarik , Mahesh J Salgaonkar , Sourabh Jain , lkml , linuxppc-dev , Mimi Zohar , Vivek Goyal , Dave Young , Thiago Jung Bauermann , Eric Biederman References: <159319825403.16351.7253978047621755765.stgit@hbathini.in.ibm.com> <159319831192.16351.17443438699302756548.stgit@hbathini.in.ibm.com> <9cfda789-0747-a67a-b825-5ea6f15099b8@redhat.com> From: Hari Bathini Message-ID: Date: Mon, 29 Jun 2020 11:25:02 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <9cfda789-0747-a67a-b825-5ea6f15099b8@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216,18.0.687 definitions=2020-06-29_04:2020-06-26,2020-06-29 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 clxscore=1015 mlxlogscore=999 impostorscore=0 lowpriorityscore=0 suspectscore=0 mlxscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 phishscore=0 cotscore=-2147483648 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006290039 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > I guess you have a design for future. If not true, then it is better to > fold the condition "if (kbuf->image->type != KEXEC_TYPE_CRASH)" into the > caller and rename this function to better distinguish use cases between > kexec and kdump Yeah, this condition will be folded. I have a follow-up patch for that explaining why kexec case should also be folded. Will try to add that to this series for v2. Thanks Hari