linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Young <dyoung@redhat.com>
To: Vivek Goyal <vgoyal@redhat.com>
Cc: linux-kernel@vger.kernel.org, kexec@lists.infradead.org,
	ebiederm@xmission.com, ptesarik@suse.cz, tytso@mit.edu,
	jwboyer@fedoraproject.org, dhowells@redhat.com,
	akpm@linux-foundation.org, geert@linux-m68k.org
Subject: Re: [PATCH V2 2/2] kexec: split kexec_load syscall from kexec core code
Date: Wed, 22 Jul 2015 10:14:08 +0800	[thread overview]
Message-ID: <20150722021408.GA16615@dhcp-128-11.nay.redhat.com> (raw)
In-Reply-To: <20150721130308.GB5053@redhat.com>

On 07/21/15 at 09:03am, Vivek Goyal wrote:
> On Mon, Jul 20, 2015 at 04:37:15PM +0800, dyoung@redhat.com wrote:
> > Now there's two kexec load syscall, one is kexec_load another is
> > kexec_file_load, kexec_file_load has been splited as kernel/kexec_file.c.
> > In this patch I split kexec_load syscall code to kernel/kexec.c.
> 
> Hi Dave,
> 
> Nice work. Thanks for doing this. I have couple of minor comments.
> 
> - We might have to audit kernel/kexec_core.c. I think there are some
>   functions in there which are used by only old syscall and not the new
>   one. All that code should be in kernel/kexec.c. Only the code which is
>   shared between two syscalls should be in kernel/kexec_core.c.
>   
>   For example, I think kimage_alloc_init() is used by old syscall only.
>   New syscall uses kimage_file_alloc_init().

You are right, actually two functions
copy_user_segment_list and kimage_alloc_init are used by kexec.c only

Will move them to kexec.c from kexec_core.c, it works well during my testing

> 
> [..]
> > --- linux.orig/include/linux/kexec.h
> > +++ linux/include/linux/kexec.h
> > @@ -16,7 +16,7 @@
> >  
> >  #include <uapi/linux/kexec.h>
> >  
> > -#ifdef CONFIG_KEXEC
> > +#ifdef CONFIG_KEXEC_CORE
> >  #include <linux/list.h>
> >  #include <linux/linkage.h>
> >  #include <linux/compat.h>
> > @@ -318,12 +318,18 @@ int crash_shrink_memory(unsigned long ne
> >  size_t crash_get_memory_size(void);
> >  void crash_free_reserved_phys_range(unsigned long begin, unsigned long end);
> >  
> > -#else /* !CONFIG_KEXEC */
> > +#ifdef CONFIG_KEXEC
> > +int kimage_alloc_init(struct kimage **rimage, unsigned long entry,
> > +			     unsigned long nr_segments,
> > +			     struct kexec_segment __user *segments,
> > +			     unsigned long flags);
> > +#endif
> 
> I am wondering why this needs to be in kexec.h. Who needs this? Even if
> somebody needs this, this should probably be outside of KEXEC_CORE.

It was added here in 1st version before adding kexec_internal.h, later
I moved most of them to kexec_internal.h, but yes it is not used by
any file other than kexec.c, will drop this chunk.

Thanks a lot
Dave

  reply	other threads:[~2015-07-22  2:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-20  8:37 [PATCH V2 0/2] kexec: refactor CONFIG_KEXEC/CONFIG_KEXEC_FILE Kconfig dyoung
2015-07-20  8:37 ` [PATCH V2 1/2] kexec: split kexec_file syscall code to kexec_file.c dyoung
2015-07-20  8:37 ` [PATCH V2 2/2] kexec: split kexec_load syscall from kexec core code dyoung
2015-07-21 13:03   ` Vivek Goyal
2015-07-22  2:14     ` Dave Young [this message]
2015-07-22  2:19   ` [PATCH V2 2/2 update] " Dave Young
2015-07-22  2:31     ` Dave Young

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=20150722021408.GA16615@dhcp-128-11.nay.redhat.com \
    --to=dyoung@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=geert@linux-m68k.org \
    --cc=jwboyer@fedoraproject.org \
    --cc=kexec@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ptesarik@suse.cz \
    --cc=tytso@mit.edu \
    --cc=vgoyal@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).