From nobody Sun Feb 8 07:22:27 2026 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 77D0E217F36 for ; Mon, 3 Nov 2025 03:59:30 +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=1762142372; cv=none; b=adkQ+sBOKz3u2fVMbqi5oMZHCF3J/PZbMROBJL4jL8bSmtS4QiGPGRID6T7YCKhBJOaKL6KZrYVJhyIJDjD92i/dranUv8cmh6daCSDmcx+Kf2e3tlPHggXjU+Bievx+k60YqJhAR1STZwW99G+j3J4wShfDYUg/nrPcQ8Inpdk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762142372; c=relaxed/simple; bh=Bw0oKHg1hLm6V18fen1GNxOcG//SIbuMnxC8Y83rE0Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nDkx5d5/o734MIK69DLsG7fFFqka4kRTNap/OBBsWD5ow07mPdD51+gXqk+Rccl9+uAq4MCFeJezo0Rxeb/gNjC2qcaCYyEb/JXdqJqozeUNw91r1xNURmR2WeY3kU0hDHpREavvjp8WBepLttXPGmYW41wu3lVandPU0JThFaM= 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=fwOqHiQk; 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="fwOqHiQk" 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 5A2MF9da009612; Mon, 3 Nov 2025 03:59:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=AvZ5h3INQpFqq+KEo b2CI2+cmj/XeytnIj7tkIJp3SI=; b=fwOqHiQkrmHDr+zJt6txf13OIXPx9U90a mtrDpNRuXeTaO18+V9jbIfvOG2GGuImenAYrHPvC3MEiQwIzQjQDxISM7K8HvShm 9uPn3oLvHqwizGEchYnvj99nBHDZLjrY1Y2l4Ig3549qwWKQnMjrTf6BI8Wk2YE2 1e//TinIvkJX8mjzDj0aRHe0psXYpETkp+ANF0UiyfkB4Sx7w/spAdg3a6Oz0ptF ePi9HQncdU8z78sZWHrbYAiFpPvs4CMZj4ksFv7u5AkSZai2bJ5KgMgXcnhLVGLX oBHXBz2BSCIKUpvi9Q15XVG+nK/DDAFduipGYqsoooIcgCyl+jvWg== 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 4a59xbmtpk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Nov 2025 03:59:21 +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 5A33nSdw021482; Mon, 3 Nov 2025 03:59:20 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4a5xrjbgnt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Nov 2025 03:59:20 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 5A33xGZi42860880 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 3 Nov 2025 03:59:17 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D80652004B; Mon, 3 Nov 2025 03:59:16 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CBBF92004E; Mon, 3 Nov 2025 03:59:14 +0000 (GMT) Received: from li-4f5ba44c-27d4-11b2-a85c-a08f5b49eada.in.ibm.com (unknown [9.109.204.116]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 3 Nov 2025 03:59:14 +0000 (GMT) From: Sourabh Jain To: linux-kernel@vger.kernel.org Cc: Sourabh Jain , Andrew Morton , Baoquan he , Jiri Bohac , Shivang Upadhyay , linuxppc-dev@lists.ozlabs.org, kexec@lists.infradead.org Subject: [PATCH 1/2] Documentation/ABI: add kexec and kdump sysfs interface Date: Mon, 3 Nov 2025 09:28:58 +0530 Message-ID: <20251103035859.1267318-2-sourabhjain@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251103035859.1267318-1-sourabhjain@linux.ibm.com> References: <20251103035859.1267318-1-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-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTAxMDAyMSBTYWx0ZWRfX5QmfpHgpw709 hIObubPd11xxVuh3XF3PahdPxZWlo5i8W+sscUSWulprIaaEwlTUS8WbKF/xLPb5FOaw+2ItYHt SUQQoCYR+ZWo5e6ZRrch18QbF9vwrf439d41ZmM+O0yk/vpT4y8MuccWM8cqKYsSB6G9Z9UBkVI jGKDdMqgIXzS/6KSP3sd7veez00pcQfmM4gL21fI0X/ca7nvd/PBdvikxVIkK30jICdYwfAF+hO 2RdN9hfQ5ZicYxQ+PUWcxIsv0AagmnjOolxncUYrzosyJhoy/a4JmiW2Yw4WkH2qYas0eNsiUvN s0IQZHkdYl3WysVCafzW0rotozDlZ0heIdSWgHStd+0vhq1vdWNRHfGjq4JSLYNxsirKVsEOl22 erkz8fhLrZYfy4lSVa/IIflrkKq8CQ== X-Proofpoint-GUID: SXkr0TzIn_er3yoERIrscZ33zWghVEpq X-Authority-Analysis: v=2.4 cv=OdCVzxTY c=1 sm=1 tr=0 ts=69082899 cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17 a=6UeiqGixMTsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=Z4Rwk6OoAAAA:8 a=20KFwNOVAAAA:8 a=VnNF1IyMAAAA:8 a=voM4FWlXAAAA:8 a=JfrnYn6hAAAA:8 a=ZOjX3YdM_w__wJIrIs4A:9 a=HkZW87K1Qel5hWWM3VKY:22 a=IC2XNlieTeVoXbcui8wp:22 a=1CNFftbPRP8L7MoqJWF3:22 a=cPQSjfK2_nFv0Q5t_7PE:22 X-Proofpoint-ORIG-GUID: SXkr0TzIn_er3yoERIrscZ33zWghVEpq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-02_02,2025-10-29_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 spamscore=0 suspectscore=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 clxscore=1015 phishscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2510240000 definitions=main-2511010021 Content-Type: text/plain; charset="utf-8" Add an ABI document for following kexec and kdump sysfs interface: - /sys/kernel/kexec_loaded - /sys/kernel/kexec_crash_loaded - /sys/kernel/kexec_crash_size - /sys/kernel/crash_elfcorehdr_size Cc: Andrew Morton Cc: Baoquan he Cc: Jiri Bohac Cc: Shivang Upadhyay Cc: linuxppc-dev@lists.ozlabs.org Cc: kexec@lists.infradead.org Signed-off-by: Sourabh Jain --- .../ABI/testing/sysfs-kernel-kexec-kdump | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-kernel-kexec-kdump diff --git a/Documentation/ABI/testing/sysfs-kernel-kexec-kdump b/Documenta= tion/ABI/testing/sysfs-kernel-kexec-kdump new file mode 100644 index 000000000000..96b24565b68e --- /dev/null +++ b/Documentation/ABI/testing/sysfs-kernel-kexec-kdump @@ -0,0 +1,43 @@ +What: /sys/kernel/kexec_loaded +Date: Jun 2006 +Contact: kexec@lists.infradead.org +Description: read only + Indicates whether a new kernel image has been loaded + into memory using the kexec system call. It shows 1 if + a kexec image is present and ready to boot, or 0 if none + is loaded. +User: kexec tools, kdump service + +What: /sys/kernel/kexec_crash_loaded +Date: Jun 2006 +Contact: kexec@lists.infradead.org +Description: read only + Indicates whether a crash (kdump) kernel is currently + loaded into memory. It shows 1 if a crash kernel has been + successfully loaded for panic handling, or 0 if no crash + kernel is present. +User: Kexec tools, Kdump service + +What: /sys/kernel/kexec_crash_size +Date: Dec 2009 +Contact: kexec@lists.infradead.org +Description: read/write + Shows the amount of memory reserved for loading the crash + (kdump) kernel. It reports the size, in bytes, of the + crash kernel area defined by the crashkernel=3D parameter. + This interface also allows reducing the crashkernel + reservation by writing a smaller value, and the reclaimed + space is added back to the system RAM. +User: Kdump service + +What: /sys/kernel/crash_elfcorehdr_size +Date: Aug 2023 +Contact: kexec@lists.infradead.org +Description: read only + Indicates the preferred size of the memory buffer for the + ELF core header used by the crash (kdump) kernel. It defines + how much space is needed to hold metadata about the crashed + system, including CPU and memory information. This information + is used by the user space utility kexec to support updating the + in-kernel kdump image during hotplug operations. +User: Kexec tools --=20 2.51.0 From nobody Sun Feb 8 07:22:27 2026 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 52A3728C862 for ; Mon, 3 Nov 2025 03:59:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762142376; cv=none; b=HZsGvdVc+KsCkbM7x64fDmvqx90e0AukS0kv+Mr70yOrFL5y5H1RESJH3HTl8LRpfyGiETmUEGlYyAbZIW0pnQAshpBfDj+6qeoLKlnbr4nmCy0WRuZBWQaDJKIfe242H2sYHpYgcP/BSt9vDybqwjw9XuszW1AvnjpUiRrdDqQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762142376; c=relaxed/simple; bh=h/BsebbZ4wBvM6Vyh3z7JbmpZtauPBFqptNV+1Iyrkg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=od9hglwNB/taP8y0gRaXMH/Z5QD9DCr8HGfhqlN8Be1UBhv8NCF7SNbYbOBXyIDOK8n4aTTb+eQWVj01ZyWCLlTY1ouY7K2YikiPHuTrk6Kw9OA1TIUbgZYn4KTApFzjbQo4RlbC8SpZjLKUAaqmoX9jqu9/qa3iCfyw2nOolIE= 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=YE6LC3hX; arc=none smtp.client-ip=148.163.158.5 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="YE6LC3hX" Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5A2LjECd010334; Mon, 3 Nov 2025 03:59:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=ZPZsTXk92qwOQf9lG LrlH/F3vYa3J75iomls7UbiwMU=; b=YE6LC3hXW1gooxS0Xfn0xaKhSdh0cgqrw jNawS3mu1YR+lGhKWP11tbopZpjC6rjWf0NU8uBrjQB4Pgjsd+x/5qWu82CKCVPI VZnq8fV0EI2DdFXl/CkhQocm86f/138bJlLR2aPHTXKpswOyamihiETYnN80Bmb1 wudneDGSiHYaef5a4WNIYKpCDA/XXJl9EtAG6qs0evKmAWMRntXqUTzzD1T6Fa7t zhUCgTqEcCuqdU3EVIwcvq9NGEhkewHjq968xQfHe0ogigY3bmxU4b0JbTutQmhN MBSN19VMvlxmCC9TnYo3M/2R35n6q7fjmBOcrSIzbB1OjbvNHv8/A== Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4a59v1ms6t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Nov 2025 03:59:24 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 5A33UExT009874; Mon, 3 Nov 2025 03:59:24 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4a5x1k3mpt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 03 Nov 2025 03:59:23 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 5A33xKhp42467762 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 3 Nov 2025 03:59:20 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 040282004E; Mon, 3 Nov 2025 03:59:20 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 01E592004B; Mon, 3 Nov 2025 03:59:18 +0000 (GMT) Received: from li-4f5ba44c-27d4-11b2-a85c-a08f5b49eada.in.ibm.com (unknown [9.109.204.116]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 3 Nov 2025 03:59:17 +0000 (GMT) From: Sourabh Jain To: linux-kernel@vger.kernel.org Cc: Sourabh Jain , Andrew Morton , Baoquan he , Jiri Bohac , Shivang Upadhyay , linuxppc-dev@lists.ozlabs.org, kexec@lists.infradead.org Subject: [PATCH 2/2] crash: export crashkernel CMA reservation to userspace Date: Mon, 3 Nov 2025 09:28:59 +0530 Message-ID: <20251103035859.1267318-3-sourabhjain@linux.ibm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251103035859.1267318-1-sourabhjain@linux.ibm.com> References: <20251103035859.1267318-1-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-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 8YErAyaTIp0NQGWWgShZOZMcihC7I2Bd X-Proofpoint-ORIG-GUID: 8YErAyaTIp0NQGWWgShZOZMcihC7I2Bd X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTAxMDAyMSBTYWx0ZWRfX9/YTQbBRYTQg bFIRQ5u91E8//hRZZL4Nt8RrkCh2AChSu5SQy+MjmJ6JzF5WP3ZjgyFEy4h9L8haYIkLekJAgnF 87VbtUFuoCAVdfcoyZ5cGT3H+MHkf/092vdic01/7KbBhO+ecWgLpNg0sZJSK4L+xIYMaWaNO/V +TlU7l//PLnlVcux6re3845ZV2eTQXMu1IWsNg8RKyREEvgQaEBrqTqt18NMkKtHU51T/AGzIEM Y1pQyjNrs8WcO+3ujeKOicR5QS/5gsVCK2rq6sxDvxa2/N+LCLRoIrgMOl46jlSh2EdK8rqjHSV Q/Qn0u096a3MoGtlWFzSVv1WNdL9URvzWsjhYbfdAKtQiCVvtwkIrimK/Vk7a5mdxddDEtab9aF 1Od5hUOAGp1j6zlslQrfrKu1rwNBCw== X-Authority-Analysis: v=2.4 cv=H8HWAuYi c=1 sm=1 tr=0 ts=6908289c cx=c_pps a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17 a=6UeiqGixMTsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=Z4Rwk6OoAAAA:8 a=20KFwNOVAAAA:8 a=VnNF1IyMAAAA:8 a=voM4FWlXAAAA:8 a=JfrnYn6hAAAA:8 a=8KeDlnjoBlZ3mOFQgX4A:9 a=HkZW87K1Qel5hWWM3VKY:22 a=IC2XNlieTeVoXbcui8wp:22 a=1CNFftbPRP8L7MoqJWF3:22 a=cPQSjfK2_nFv0Q5t_7PE:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-02_02,2025-10-29_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 phishscore=0 lowpriorityscore=0 priorityscore=1501 adultscore=0 impostorscore=0 clxscore=1015 bulkscore=0 suspectscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2510240000 definitions=main-2511010021 Content-Type: text/plain; charset="utf-8" Add a sysfs entry /sys/kernel/kexec_crash_cma_ranges to expose all CMA crashkernel ranges. This allows userspace tools configuring kdump to determine how much memory is reserved for crashkernel. If CMA is used, tools can warn users when attempting to capture user pages with CMA reservation. The new sysfs hold the CMA ranges in below format: cat /sys/kernel/kexec_crash_cma_ranges 100000000-10c7fffff Cc: Andrew Morton Cc: Baoquan he Cc: Jiri Bohac Cc: Shivang Upadhyay Cc: linuxppc-dev@lists.ozlabs.org Cc: kexec@lists.infradead.org Signed-off-by: Sourabh Jain --- .../ABI/testing/sysfs-kernel-kexec-kdump | 10 ++++++++++ kernel/ksysfs.c | 17 +++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-kernel-kexec-kdump b/Documenta= tion/ABI/testing/sysfs-kernel-kexec-kdump index 96b24565b68e..f6089e38de5f 100644 --- a/Documentation/ABI/testing/sysfs-kernel-kexec-kdump +++ b/Documentation/ABI/testing/sysfs-kernel-kexec-kdump @@ -41,3 +41,13 @@ Description: read only is used by the user space utility kexec to support updating the in-kernel kdump image during hotplug operations. User: Kexec tools + +What: /sys/kernel/kexec_crash_cma_ranges +Date: Nov 2025 +Contact: kexec@lists.infradead.org +Description: read only + Provides information about the memory ranges reserved from + the Contiguous Memory Allocator (CMA) area that are allocated + to the crash (kdump) kernel. It lists the start and end physical + addresses of CMA regions assigned for crashkernel use. +User: kdump service diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c index eefb67d9883c..3855937aa923 100644 --- a/kernel/ksysfs.c +++ b/kernel/ksysfs.c @@ -135,6 +135,22 @@ static ssize_t kexec_crash_loaded_show(struct kobject = *kobj, } KERNEL_ATTR_RO(kexec_crash_loaded); =20 +static ssize_t kexec_crash_cma_ranges_show(struct kobject *kobj, + struct kobj_attribute *attr, char *buf) +{ + + ssize_t len =3D 0; + int i; + + for (i =3D 0; i < crashk_cma_cnt; ++i) { + len +=3D sysfs_emit_at(buf, len, "%08llx-%08llx\n", + crashk_cma_ranges[i].start, + crashk_cma_ranges[i].end); + } + return len; +} +KERNEL_ATTR_RO(kexec_crash_cma_ranges); + static ssize_t kexec_crash_size_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { @@ -260,6 +276,7 @@ static struct attribute * kernel_attrs[] =3D { #ifdef CONFIG_CRASH_DUMP &kexec_crash_loaded_attr.attr, &kexec_crash_size_attr.attr, + &kexec_crash_cma_ranges_attr.attr, #endif #endif #ifdef CONFIG_VMCORE_INFO --=20 2.51.0