Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1743271rdb; Tue, 20 Feb 2024 05:57:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXzSFBVOExN+QRuE3Kbn3U393peJ16gZl0mMWbHSIm9Wa8Hldk0Uj0nLPmZ91EvvR/XPrUC7Xuu3gESREgjj0UTs1wsS2BbluN0tKro3A== X-Google-Smtp-Source: AGHT+IGhrbbCIpKvUFcd3frS+igWUhVYKFfIJXclczaBhLdLTxUTa/cuQBXgQQgNCXFPDh3n+4PM X-Received: by 2002:a05:6871:823:b0:219:570f:31db with SMTP id q35-20020a056871082300b00219570f31dbmr16945983oap.10.1708437423001; Tue, 20 Feb 2024 05:57:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708437422; cv=pass; d=google.com; s=arc-20160816; b=0mRDIW+8X+4caUbzBs8rXz4SKkUYU7A6Wa6HOeTJ1ZtTAcJ+aog8Ew8IPGR6lvkE7X Ple42uUKS3lWoWRBIZVDYU0b2/LA81pMusxELVF/fO9ecXsKK+N9Ec9M7LurvIfjGDL8 lE+Is68B3Wx3vuEEgmYNLngSrIMKegg9Bgmuy7olW9q8sHvGvLEnavphxaD3qv/bEGSh PCcCmwldKU+7z2E5KlJ4WBLuDMEdI5uKEGffMPYbS8kJ6IVvG34PlkTbarUPxIZN8jhX FqLKtuiIL7DqJGTwAN7MaXFiFE429ftv6Ro4AljR4nis4PPh8krHynDfIkeQ9G3rGhNK Rd+w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=GAc6rry3Nc1ghTKhHNX98UJdceAOZ+259mLdb94DPrE=; fh=urmEy3Abx+qCJcSH684ePKocpYfQaVLSzTlocivlqW0=; b=nRA5CjosNDJaDvL9DuwJk1TPwxIj6s2IxWudaLRW7c8HHjovjTV1HwWPTwJDvOR815 Y9ZvTYrEnnpu7NCkeiB2xBNFiPSx6Z095gdkpOxW41Kh6/dJfMK4VqjNNMCI5/KXvIL9 Jv5rGsDTUE0B3h9njT6lnsZmfvObLnGeRCHJsrl2t5Qvfhj7fLrztQmArbzNFGAju2a3 rBAMRWwlHjanAyzS9oi/gO60u9rKvT+bo4gKvtZJVh5mTEBVB7JebhuOBwCenhSM3XWx K6DSfzNF1D+yRLJZxIYPG6/cXDisbAyFVqHmMMEK+3qOeDarHdFovl53Nw/TF0TJCMKp MkCA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Qrzm067k; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-73107-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73107-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id p18-20020a639512000000b005dcb4f1acc6si6359811pgd.176.2024.02.20.05.57.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 05:57:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-73107-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Qrzm067k; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-73107-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73107-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 7478AB2323D for ; Tue, 20 Feb 2024 13:52:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C80D56BFD5; Tue, 20 Feb 2024 13:50:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Qrzm067k" 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 49E39612C0 for ; Tue, 20 Feb 2024 13:50:37 +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=1708437039; cv=none; b=hchLeH0O930XMpkurZh4tEJHFoiSQGz8t5eJR1V0KT54f4H9WbRTDxQCjqN7Jxrf+4LIx+sWNvsOnUV9B83vbMLtUUst9GQSCSCttZJoHJIgQtd3UpFxzzMozv2ml2M7XAIl1r+eV/7bxcErquFUFpnqLCEHu9M30tAFr3tufAI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708437039; c=relaxed/simple; bh=KCOTNBqFBm+OTafgGfuv+94MIKpF0BHHvxNLIXcl2yE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nuKuLoxRQkH+Vbn+UH3CG5MJ2LuqufGZnygsxVC7RVOGScpISDTqMg6sJIBWZOh5euU3eT24WhAbZRNV81SsopuENLslkmQfR0McMg5gESkpX1Tjc+yp7JjztD4e6nqZlS4j/XGqkx/BhBEBYFA/ipZ37WclZMlTY1rGdLh58YY= 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=Qrzm067k; 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708437036; 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=GAc6rry3Nc1ghTKhHNX98UJdceAOZ+259mLdb94DPrE=; b=Qrzm067kLWDhKC8o16hwbcIVFHyS31MJiBcsK9Cgf7hIOqXvXoabuyU17u3m7NTIia6RTE nKoeycSgqC5nnDh3lZN8KcVp6ZbeE65bihV5NIXEPB+D6rtdQ+GGsVZHXJiSaOGTNPWQDI pehkMTJ2H3zKuEuGXxmFtSKlUcEat6I= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-635-wGfgPk9mM22_nJxY97dI-w-1; Tue, 20 Feb 2024 08:50:32 -0500 X-MC-Unique: wGfgPk9mM22_nJxY97dI-w-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (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 mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2B54D185A782; Tue, 20 Feb 2024 13:50:32 +0000 (UTC) Received: from localhost (unknown [10.72.116.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C3E25C185C3; Tue, 20 Feb 2024 13:50:29 +0000 (UTC) Date: Tue, 20 Feb 2024 21:50:26 +0800 From: Baoquan He To: Hari Bathini Cc: linuxppc-dev , Kexec-ml , lkml , Michael Ellerman , Mahesh J Salgaonkar , Sourabh Jain , Dave Young , Andrew Morton , Nicholas Piggin , "Naveen N. Rao" , Christophe Leroy Subject: Re: [PATCH linux-next 1/3] kexec/kdump: make struct crash_mem available without CONFIG_CRASH_DUMP Message-ID: References: <20240213113150.1148276-1-hbathini@linux.ibm.com> <20240213113150.1148276-2-hbathini@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: <20240213113150.1148276-2-hbathini@linux.ibm.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 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 > --- > 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 >