Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755599AbbGVCOZ (ORCPT ); Tue, 21 Jul 2015 22:14:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51543 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754071AbbGVCOY (ORCPT ); Tue, 21 Jul 2015 22:14:24 -0400 Date: Wed, 22 Jul 2015 10:14:08 +0800 From: Dave Young To: Vivek Goyal 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 Message-ID: <20150722021408.GA16615@dhcp-128-11.nay.redhat.com> References: <20150720083713.528114272@redhat.com> <20150720084558.645442047@redhat.com> <20150721130308.GB5053@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150721130308.GB5053@redhat.com> User-Agent: Mutt/1.5.22.1-rc1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2385 Lines: 62 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 > > > > -#ifdef CONFIG_KEXEC > > +#ifdef CONFIG_KEXEC_CORE > > #include > > #include > > #include > > @@ -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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/