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 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Qrzm067k" 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 >