[linux-next,1/3] kexec/kdump: make struct crash_mem available without CONFIG_CRASH_DUMP
Message ID | 20240213113150.1148276-2-hbathini@linux.ibm.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-63440-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp472413dyb; Tue, 13 Feb 2024 03:32:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IELhyczjkVS7a6QK51ikTle+7ani3ufMKuuyr2+qTsqlqtU5cX9V5BaVdotcWcUSpOSDzzG X-Received: by 2002:a25:ef47:0:b0:dc9:51d8:d72c with SMTP id w7-20020a25ef47000000b00dc951d8d72cmr5028037ybm.63.1707823965089; Tue, 13 Feb 2024 03:32:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707823965; cv=pass; d=google.com; s=arc-20160816; b=dUo6voTHVN+R2Dn+qqDg10x4ilck9fLrsWGN1eQ7Db8GPJxodq8LTsTnMcVczAtF4M fORjDsxkOq+l4ITYP16hGzING1ux2lPpUcGWmapZ+AC/nC0o45NkCwe6aN/gTVIpZLaM 25Ph55KBym4MsPdXh3j0S6x2Z3ONi9/MTR05QRClSwVFuUcqB0AprZzDQzciRb0TYWqG ExaJNQlKSJQ05h4s18UuugXHwk65X0rCqRbtM4QHVe7yheUVUELKCrCQysd8gMnfhXL8 9sw18o5KWNb4mhqGqAZg18ZzuYtnqjzews4XRsvszI5AGaEAK+NF7kWUtkjUSZHWdFa7 HCtg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=H4n7Gti0DQpKf+Lev3b2U1UIu6/NC1ZAUUgGWt0NH4A=; fh=yd07bq3wOVfIRejl6jaUhxkHGqlf5fEkZfe/Zl6Foqs=; b=HialzvfgVRGHmKliNqtCvRAvTVNypNDBcCUHhYoy2UVocW7ABidZ2qZhrb6cski3+x 3pl37Y+Yov1wqjMWaUfNsB4SKu7IYfcLpLnkqoqr5uC7oTkMkjMV2VQdi1Ygm5sMsAPk yPhI7AG1PHtVzDkPz0JOKDkEL5zrZd65xKjwItX2LZkZgFe4I6kU8Ro2hCr1XWRAhZiO kkmU0+0P0sYvdlovxFwdeBkPKHVVorXuQCk8uT86TzAdfDG+i6vgAruHvnT2asZj6KAy tyX1qK9r6N8ZNLhGad3Y967SWwKSiygLHjBUmOB9vQfxipEsA4vrSJnRAC5JRhaKj6k9 ZLJg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=BeY7dFlp; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-63440-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63440-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com X-Forwarded-Encrypted: i=2; AJvYcCXiKyuCT/r2N+IGQm9hrbUC5JR2d9ZnhC1WjjzH1mpy/1ajNW/hAfEp8lmIMLOTiu+w3F3VbByXUINa9j1qzki25q1qcw== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h11-20020a05620a13eb00b0078724a778f4si67573qkl.206.2024.02.13.03.32.44 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 03:32:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63440-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=BeY7dFlp; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-63440-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63440-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id DCAFD1C22275 for <ouuuleilei@gmail.com>; Tue, 13 Feb 2024 11:32:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0D562383B9; Tue, 13 Feb 2024 11:32:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="BeY7dFlp" 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 EB18F364C1 for <linux-kernel@vger.kernel.org>; Tue, 13 Feb 2024 11:32:14 +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=1707823936; cv=none; b=Q/FZ3ZkocQfBCBZTclcm3WZxWPjMLrwI5cfoPCUIpkCZVrUZtK5/OuzSHe2txAKBbuOfBW7dl4knZUNeUs76v9u1E/WgjYlO39eouAzwwU/GYPsTfCh1wxVgkuEWoNz0k68zcvdLPUc1/fuYaOyNDta/23fSzdEUwVS3alht5dM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707823936; c=relaxed/simple; bh=Aa073cl3kqnphTf8b6BN7oCcURDXbs4boksLOpQndAk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VKbzZ2J7qruM0WGF7ZT+iU4kSAZ+NeSz+fO9Wn5LOFHl6xRLHbJwyQl8KVHa4mEPySWhdMfBng3y+w5BR++7Q8IG+AVO+jfUlWpXrQHJ6yyHijks2wwCd8n6YIxjK2pgPZZm6ePQEGmlqGjMOIAxpDEBIP50HD4WqLmtENkQwao= 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=BeY7dFlp; 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 Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41DB2XCx001458; Tue, 13 Feb 2024 11:32:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=H4n7Gti0DQpKf+Lev3b2U1UIu6/NC1ZAUUgGWt0NH4A=; b=BeY7dFlpHB6ll/tirYvog5WZor0e08M9RwzIDLCdajD8RcPgPmPBpw8P+Xwt1PMtpkkE IRdtCe5jvojDDhkMe5gWU3l071WgfKkkt/FfvJbpvVRrb8TC0fsSi731fwBJXgStszAD Xwr9bH5wXcHUhdGtJJPq1w9mXDF3AnQWXHlhzkQyEUYNSTOD+40EpEWKXoS7RSv+Ikin +yV5OWIc3r+ew/ShuWEFnhQomJ9X6V6zCf//rSVATxvB0qj3N9TH+ab7Mk35sfNckzg9 FD01/xh6LXzX7zbtsWEn4MU8X6VdeYo2ZeSrbPuPJPCuzSzvkcmf5960nwaHc+t46GvB VA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3w876tgk5a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Feb 2024 11:32:03 +0000 Received: from m0353729.ppops.net (m0353729.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 41DBP74E020242; Tue, 13 Feb 2024 11:32:03 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3w876tgk41-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Feb 2024 11:32:02 +0000 Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 41D9kDhE009728; Tue, 13 Feb 2024 11:32:02 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3w6p62phjq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Feb 2024 11:32:01 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 41DBVvkY31326602 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Feb 2024 11:31:59 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 192002004B; Tue, 13 Feb 2024 11:31:57 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 525FA20040; Tue, 13 Feb 2024 11:31:54 +0000 (GMT) Received: from li-bd3f974c-2712-11b2-a85c-df1cec4d728e.in.ibm.com (unknown [9.203.115.195]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 13 Feb 2024 11:31:54 +0000 (GMT) From: Hari Bathini <hbathini@linux.ibm.com> To: linuxppc-dev <linuxppc-dev@lists.ozlabs.org>, Kexec-ml <kexec@lists.infradead.org> Cc: lkml <linux-kernel@vger.kernel.org>, Michael Ellerman <mpe@ellerman.id.au>, Mahesh J Salgaonkar <mahesh@linux.ibm.com>, Sourabh Jain <sourabhjain@linux.ibm.com>, Dave Young <dyoung@redhat.com>, Baoquan He <bhe@redhat.com>, Andrew Morton <akpm@linux-foundation.org>, Nicholas Piggin <npiggin@gmail.com>, "Naveen N. Rao" <naveen.n.rao@linux.ibm.com>, Christophe Leroy <christophe.leroy@csgroup.eu> Subject: [PATCH linux-next 1/3] kexec/kdump: make struct crash_mem available without CONFIG_CRASH_DUMP Date: Tue, 13 Feb 2024 17:01:47 +0530 Message-ID: <20240213113150.1148276-2-hbathini@linux.ibm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240213113150.1148276-1-hbathini@linux.ibm.com> References: <20240213113150.1148276-1-hbathini@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: TVZ2HrHNgGxAqkRWyrbg9EsaotK3-Ut3 X-Proofpoint-GUID: W03R_p21SDHzPOy2M12oBn2E8MCT4U5z X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-13_06,2024-02-12_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 spamscore=0 bulkscore=0 mlxlogscore=999 phishscore=0 impostorscore=0 clxscore=1015 mlxscore=0 suspectscore=0 lowpriorityscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402130091 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790783221781930894 X-GMAIL-MSGID: 1790783221781930894 |
Series |
powerpc/kexec: split CONFIG_CRASH_DUMP out from CONFIG_KEXEC_CORE
|
|
Commit Message
Hari Bathini
Feb. 13, 2024, 11:31 a.m. UTC
struct crash_mem defined under include/linux/crash_core.h represents
a list of memory ranges. While it is used to represent memory ranges
for kdump kernel, it can also be used for other kind of memory ranges.
In fact, KEXEC_FILE_LOAD syscall in powerpc uses this structure to
represent reserved memory ranges and exclude memory ranges needed to
find the right memory regions to load kexec kernel. So, make the
definition of crash_mem structure available for !CONFIG_CRASH_DUMP
case too.
Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
---
include/linux/crash_core.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
Comments
On 02/13/24 at 05:01pm, Hari Bathini wrote: > struct crash_mem defined under include/linux/crash_core.h represents > a list of memory ranges. While it is used to represent memory ranges From its name, it's not only representing memory ranges, it's representing crash memory ranges. Except of this, the whole series looks good to me. Thanks for the effort. > for kdump kernel, it can also be used for other kind of memory ranges. > In fact, KEXEC_FILE_LOAD syscall in powerpc uses this structure to > represent reserved memory ranges and exclude memory ranges needed to > find the right memory regions to load kexec kernel. So, make the > definition of crash_mem structure available for !CONFIG_CRASH_DUMP > case too. > > Signed-off-by: Hari Bathini <hbathini@linux.ibm.com> > --- > include/linux/crash_core.h | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/include/linux/crash_core.h b/include/linux/crash_core.h > index 23270b16e1db..d33352c2e386 100644 > --- a/include/linux/crash_core.h > +++ b/include/linux/crash_core.h > @@ -8,6 +8,12 @@ > > struct kimage; > > +struct crash_mem { > + unsigned int max_nr_ranges; > + unsigned int nr_ranges; > + struct range ranges[] __counted_by(max_nr_ranges); > +}; > + > #ifdef CONFIG_CRASH_DUMP > > int crash_shrink_memory(unsigned long new_size); > @@ -51,12 +57,6 @@ static inline unsigned int crash_get_elfcorehdr_size(void) { return 0; } > /* Alignment required for elf header segment */ > #define ELF_CORE_HEADER_ALIGN 4096 > > -struct crash_mem { > - unsigned int max_nr_ranges; > - unsigned int nr_ranges; > - struct range ranges[] __counted_by(max_nr_ranges); > -}; > - > extern int crash_exclude_mem_range(struct crash_mem *mem, > unsigned long long mstart, > unsigned long long mend); > -- > 2.43.0 >
diff --git a/include/linux/crash_core.h b/include/linux/crash_core.h index 23270b16e1db..d33352c2e386 100644 --- a/include/linux/crash_core.h +++ b/include/linux/crash_core.h @@ -8,6 +8,12 @@ struct kimage; +struct crash_mem { + unsigned int max_nr_ranges; + unsigned int nr_ranges; + struct range ranges[] __counted_by(max_nr_ranges); +}; + #ifdef CONFIG_CRASH_DUMP int crash_shrink_memory(unsigned long new_size); @@ -51,12 +57,6 @@ static inline unsigned int crash_get_elfcorehdr_size(void) { return 0; } /* Alignment required for elf header segment */ #define ELF_CORE_HEADER_ALIGN 4096 -struct crash_mem { - unsigned int max_nr_ranges; - unsigned int nr_ranges; - struct range ranges[] __counted_by(max_nr_ranges); -}; - extern int crash_exclude_mem_range(struct crash_mem *mem, unsigned long long mstart, unsigned long long mend);