All of lore.kernel.org
 help / color / mirror / Atom feed
From: Baoquan He <bhe@redhat.com>
To: Ricardo Ribalda <ribalda@chromium.org>
Cc: Eric Biederman <ebiederm@xmission.com>,
	Philipp Rudo <prudo@redhat.com>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Ross Zwisler <zwisler@kernel.org>,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kexec: Enable runtime allocation of crash_image
Date: Fri, 25 Nov 2022 15:27:40 +0800	[thread overview]
Message-ID: <Y4BubEVKt78k8xaC@MiWiFi-R3L-srv> (raw)
In-Reply-To: <CANiDSCsgFYvShoTo9xAPe0wqSJgTnB7ZgzXmNqD+L2cKdsVoRg@mail.gmail.com>

On 11/25/22 at 06:52am, Ricardo Ribalda wrote:
> Hi Baoquan
> 
> Thanks for your review!
> 
> On Fri, 25 Nov 2022 at 03:58, Baoquan He <bhe@redhat.com> wrote:
> >
> > On 11/24/22 at 11:23pm, Ricardo Ribalda wrote:
> > > Usually crash_image is defined statically via the crashkernel parameter
> > > or DT.
> > >
> > > But if the crash kernel is not used, or is smaller than then
> > > area pre-allocated that memory is wasted.
> > >
> > > Also, if the crash kernel was not defined at bootime, there is no way to
> > > use the crash kernel.
> > >
> > > Enable runtime allocation of the crash_image if the crash_image is not
> > > defined statically. Following the same memory allocation/validation path
> > > that for the reboot kexec kernel.
> >
> > We don't check if the crashkernel memory region is valid in kernel, but
> > we do have done the check in kexec-tools utility. Since both kexec_load and
> > kexec_file_load need go through path of kexec-tools loading, we haven't
> > got problem with lack of the checking in kernel.
> 
> Not sure if I follow you.
> 
> We currently check if the crash kernel is in the right place at
> sanity_check_segment_list()
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/kexec_core.c#n239

And it's not checking if crashkernel memory is valid in
sanity_check_segment_list(), right? It's checking if the segments 
are placed correctly.


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

WARNING: multiple messages have this Message-ID (diff)
From: Baoquan He <bhe@redhat.com>
To: Ricardo Ribalda <ribalda@chromium.org>
Cc: Eric Biederman <ebiederm@xmission.com>,
	Philipp Rudo <prudo@redhat.com>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Ross Zwisler <zwisler@kernel.org>,
	kexec@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kexec: Enable runtime allocation of crash_image
Date: Fri, 25 Nov 2022 15:27:40 +0800	[thread overview]
Message-ID: <Y4BubEVKt78k8xaC@MiWiFi-R3L-srv> (raw)
In-Reply-To: <CANiDSCsgFYvShoTo9xAPe0wqSJgTnB7ZgzXmNqD+L2cKdsVoRg@mail.gmail.com>

On 11/25/22 at 06:52am, Ricardo Ribalda wrote:
> Hi Baoquan
> 
> Thanks for your review!
> 
> On Fri, 25 Nov 2022 at 03:58, Baoquan He <bhe@redhat.com> wrote:
> >
> > On 11/24/22 at 11:23pm, Ricardo Ribalda wrote:
> > > Usually crash_image is defined statically via the crashkernel parameter
> > > or DT.
> > >
> > > But if the crash kernel is not used, or is smaller than then
> > > area pre-allocated that memory is wasted.
> > >
> > > Also, if the crash kernel was not defined at bootime, there is no way to
> > > use the crash kernel.
> > >
> > > Enable runtime allocation of the crash_image if the crash_image is not
> > > defined statically. Following the same memory allocation/validation path
> > > that for the reboot kexec kernel.
> >
> > We don't check if the crashkernel memory region is valid in kernel, but
> > we do have done the check in kexec-tools utility. Since both kexec_load and
> > kexec_file_load need go through path of kexec-tools loading, we haven't
> > got problem with lack of the checking in kernel.
> 
> Not sure if I follow you.
> 
> We currently check if the crash kernel is in the right place at
> sanity_check_segment_list()
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/kexec_core.c#n239

And it's not checking if crashkernel memory is valid in
sanity_check_segment_list(), right? It's checking if the segments 
are placed correctly.


  parent reply	other threads:[~2022-11-25  7:28 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-24 22:23 [PATCH] kexec: Enable runtime allocation of crash_image Ricardo Ribalda
2022-11-24 22:23 ` Ricardo Ribalda
2022-11-25  2:58 ` Baoquan He
2022-11-25  2:58   ` Baoquan He
2022-11-25  5:52   ` Ricardo Ribalda
2022-11-25  5:52     ` Ricardo Ribalda
2022-11-25  7:15     ` Baoquan He
2022-11-25  7:15       ` Baoquan He
2022-11-25  7:26       ` Ricardo Ribalda
2022-11-25  7:26         ` Ricardo Ribalda
2022-11-25  7:44         ` Baoquan He
2022-11-25  7:44           ` Baoquan He
2022-11-25  8:10           ` Ricardo Ribalda
2022-11-25  8:10             ` Ricardo Ribalda
2022-11-25  9:27             ` Baoquan He
2022-11-25  9:27               ` Baoquan He
2022-11-25  7:27     ` Baoquan He [this message]
2022-11-25  7:27       ` Baoquan He
2022-11-25  7:31       ` Ricardo Ribalda
2022-11-25  7:31         ` Ricardo Ribalda
2022-11-25  7:48         ` Baoquan He
2022-11-25  7:48           ` Baoquan He
2022-11-28 17:00 ` Philipp Rudo
2022-11-28 17:00   ` Philipp Rudo
2022-11-28 17:07   ` Ricardo Ribalda
2022-11-28 17:07     ` Ricardo Ribalda
2022-11-29 15:12     ` Philipp Rudo
2022-11-29 15:12       ` Philipp Rudo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y4BubEVKt78k8xaC@MiWiFi-R3L-srv \
    --to=bhe@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=prudo@redhat.com \
    --cc=ribalda@chromium.org \
    --cc=senozhatsky@chromium.org \
    --cc=zwisler@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.