From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 D7A7C1A072A for ; Wed, 8 Jan 2025 11:25:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736335530; cv=none; b=cpJ7CTqY5c48r6CbZk2Fvqua8E+1nwrycY+1mNOw19aRTaSadcRuYPWNehxctJWfvoET3Uw7/3eiItEapxLjAf5MaQWuuG8rH+S8svdN3bCXNB3b3EJ+RfVt771IVnK26RjjJQ/hT2CFH5fx9jk3o7mYsALnVsPZRxOc70wzcK8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736335530; c=relaxed/simple; bh=RfIZOMxAAcnPEeqQEMCKUVcqRDOi3kfkPJtf59mrY58=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hQ8+7CuwKivY+e0vKkbPUz1qe21Ts5KAtY1JydrayFY7XC8Q3UrkzU58FS/pji1bqJhAuUELWY+HCXCcLF6oxITfvwEyj+9yWFcwd54ohAoUs7UySV/0Hs+cw2Ip7XEA2PijTSF4afVsou1Ars3xboxW4ndwEx3zy9RKFbswhBA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=H6au320U; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="H6au320U" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1736335527; 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: in-reply-to:in-reply-to:references:references; bh=3oLpbTsd6NEyHY2cucU9ZqZfMt3d6F1y8ObsntY47Ys=; b=H6au320UCg8pTYhG76voczrI/cH6Slcy5aLwd1ezAxa+McL02CmdxRsTXM4AW+CmeQLhVq kVojs3LPSD+vmZf0rTbfT2BsED6HqVlXgOP84+BOnAz/GgcOsnClKEqcZrUFv3fetBiJlF c9z5KKvO3aVRJRgTmLd6AhcspMuHm2k= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-91-DaA2zA7kN2O5kv6i9Gj8QA-1; Wed, 08 Jan 2025 06:25:24 -0500 X-MC-Unique: DaA2zA7kN2O5kv6i9Gj8QA-1 X-Mimecast-MFC-AGG-ID: DaA2zA7kN2O5kv6i9Gj8QA Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6C71F19560BD; Wed, 8 Jan 2025 11:25:22 +0000 (UTC) Received: from localhost (unknown [10.72.112.99]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B1A53300018D; Wed, 8 Jan 2025 11:25:20 +0000 (UTC) Date: Wed, 8 Jan 2025 19:25:16 +0800 From: Baoquan he To: Sourabh Jain Cc: linuxppc-dev@lists.ozlabs.org, Andrew Morton , Hari Bathini , Madhavan Srinivasan , Michael Ellerman , kexec@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RESEND v1 2/5] crash: let arch decide crash memory export to iomem_resource Message-ID: References: <20250108101458.406806-1-sourabhjain@linux.ibm.com> <20250108101458.406806-3-sourabhjain@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250108101458.406806-3-sourabhjain@linux.ibm.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 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? Now there are two branches in the existing code, adding a hook will make three ways.