From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C0CFE1F9A8C for ; Wed, 8 Jan 2025 12:02:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736337765; cv=none; b=bhBk4HILyP4irxwe/e2qJ0uzNblLNdKWP/kXlZgpE4igTlUpdThPdzsu26wz42G9XwzoapYmBgQgBMZhLNoKA46UaRrPNYiBAjKohIJh/vwRjYHIhb/rl6V8XqHbJyM5m3lX2hGg/Gls4JIOGW2LQOLkcV6XN34WC8SwAvTVcOg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736337765; c=relaxed/simple; bh=CmdP9MPheIi2VfLKa4jLFohqkkpRuEs4DH0YHJUBVug=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=nxvsrrd0I7VcJMUvctIysuPOboCAabxGfqR7Y0VFSbUJEi3KUXp1wvSZ+3Ydni0bNdHE5XxiqbEktZkabwhs1u0ZYoriZ9KrVpgr0bRuavnr/yh+9ruw2tRWL+tj9dIbZvPBVNf2OY35ccVlQatg3a0uKYAnI0JgjA4vWOhnMwI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=VoqZT8Tj; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="VoqZT8Tj" Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5083r5IL006929; Wed, 8 Jan 2025 12:02:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pp1; bh=MmS4DY Qwur7WJQ24jzp44KxvRMWZaKri3Od2Jv/tigk=; b=VoqZT8Tj0d8alM6xU2cNKQ 6+Gxe/JmeFgyneKS0QlqjLxBNXAwKRZ5zSz8NUTMyaC73b9vv9tk0ewynE23MjNZ y3jBpMaDz6A7OPv5FJR8mQj3+Jo0sx5EAtMGq97vW5u5jAUCC7zXxzsU4/+2MYlv aYJ28Fqd0HvQaop6cjxWgZo17VedG0koq+1HDvWeVNwwHsoxvst0krqCjvk+If4W huu5ytsye8aO7qmxP7PjzUceA41d8KfuG9t4O/jJRxZdmNrHX4ZqgSmgSHig4VzL GrN675+xw83dfhExgd612O8gPeLDBrvGjZ8PCfgKGnUtixCeL1pto2D9/Wp115QQ == Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 441hupt2jc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Jan 2025 12:02:27 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 508A2Bfv027997; Wed, 8 Jan 2025 12:02:26 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 43yhhk7c0s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Jan 2025 12:02:26 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 508C2MCH50594104 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 8 Jan 2025 12:02:22 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 78F2F20049; Wed, 8 Jan 2025 12:02:22 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 93A6B2004D; Wed, 8 Jan 2025 12:02:20 +0000 (GMT) Received: from [9.109.204.94] (unknown [9.109.204.94]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 8 Jan 2025 12:02:20 +0000 (GMT) Message-ID: <622d9d6d-3dfc-4bdb-b251-4abf9299fc6a@linux.ibm.com> Date: Wed, 8 Jan 2025 17:32:19 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RESEND v1 2/5] crash: let arch decide crash memory export to iomem_resource To: Baoquan he Cc: linuxppc-dev@lists.ozlabs.org, Andrew Morton , Hari Bathini , Madhavan Srinivasan , Michael Ellerman , kexec@lists.infradead.org, linux-kernel@vger.kernel.org References: <20250108101458.406806-1-sourabhjain@linux.ibm.com> <20250108101458.406806-3-sourabhjain@linux.ibm.com> Content-Language: en-US From: Sourabh Jain In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: FDF-htNt5foZo1yPQ6u0KJVXvE4WVYwE X-Proofpoint-GUID: FDF-htNt5foZo1yPQ6u0KJVXvE4WVYwE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-15_01,2024-10-11_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 clxscore=1015 mlxscore=0 malwarescore=0 priorityscore=1501 lowpriorityscore=0 spamscore=0 bulkscore=0 impostorscore=0 mlxlogscore=653 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2501080098 Hello Baoquan On 08/01/25 16:55, Baoquan he wrote: > Hi, > > On 01/08/25 at 03:44pm, Sourabh Jain wrote: >> insert_crashkernel_resources() adds crash memory to iomem_resource if >> generic crashkernel reservation is enabled on an architecture. >> >> On PowerPC, system RAM is added to iomem_resource. See commit >> c40dd2f766440 ("powerpc: Add System RAM to /proc/iomem"). >> >> Enabling generic crashkernel reservation on PowerPC leads to a conflict >> when system RAM is added to iomem_resource because a part of the system >> RAM, the crashkernel memory, has already been added to iomem_resource. >> >> The next commit in the series "powerpc/crash: use generic crashkernel >> reservation" enables generic crashkernel reservation on PowerPC. If the >> crashkernel is added to iomem_resource, the kernel fails to add >> system RAM to /proc/iomem and prints the following traces: >> >> CPU: 0 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.13.0-rc2+ >> snip... >> NIP [c000000002016b3c] add_system_ram_resources+0xf0/0x15c >> LR [c000000002016b34] add_system_ram_resources+0xe8/0x15c >> Call Trace: >> [c00000000484bbc0] [c000000002016b34] add_system_ram_resources+0xe8/0x15c >> [c00000000484bc20] [c000000000010a4c] do_one_initcall+0x7c/0x39c >> [c00000000484bd00] [c000000002005418] do_initcalls+0x144/0x18c >> [c00000000484bd90] [c000000002005714] kernel_init_freeable+0x21c/0x290 >> [c00000000484bdf0] [c0000000000110f4] kernel_init+0x2c/0x1b8 >> [c00000000484be50] [c00000000000dd3c] ret_from_kernel_user_thread+0x14/0x1c >> >> To avoid this, an architecture hook is added in >> insert_crashkernel_resources(), allowing the architecture to decide >> whether crashkernel memory should be added to iomem_resource. > Have you tried defining HAVE_ARCH_ADD_CRASH_RES_TO_IOMEM_EARLY in ppc to > add crashkernel region to iomem early? I didn’t try, but I think even if I do, the kernel will run into the same issue because as soon as crashkernel is added to iomem, there will be a resource conflict when the PowerPC code tries to add system RAM to iomem. Which happens during subsys_initcall. Regardless, I will give it a try. > Now there are two branches in the > existing code, adding a hook will make three ways. I agree. I can try updating powerpc code to not consider crashkernel memory as iomem conflict. Thanks for the review. - Sourabh Jain