From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753281AbcGSMYK (ORCPT ); Tue, 19 Jul 2016 08:24:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54036 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753080AbcGSMYI (ORCPT ); Tue, 19 Jul 2016 08:24:08 -0400 Date: Tue, 19 Jul 2016 08:24:06 -0400 From: Vivek Goyal To: Mark Rutland Cc: Dave Young , AKASHI Takahiro , bhe@redhat.com, arnd@arndb.de, linuxppc-dev@lists.ozlabs.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, ebiederm@xmission.com, bauerman@linux.vnet.ibm.com, linux-arm-kernel@lists.infradead.org Subject: Re: [RFC 3/3] kexec: extend kexec_file_load system call Message-ID: <20160719122406.GA18124@redhat.com> References: <20160712014201.11456-1-takahiro.akashi@linaro.org> <20160712014201.11456-4-takahiro.akashi@linaro.org> <20160715130955.GC23514@redhat.com> <20160715131950.GB19840@leverpostej> <20160718023024.GB6310@dhcp-128-65.nay.redhat.com> <20160718100704.GB10069@leverpostej> <20160719005556.GE3326@dhcp-128-65.nay.redhat.com> <20160719105049.GD27022@leverpostej> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160719105049.GD27022@leverpostej> User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 19 Jul 2016 12:24:08 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 19, 2016 at 11:52:00AM +0100, Mark Rutland wrote: > On Tue, Jul 19, 2016 at 08:55:56AM +0800, Dave Young wrote: > > On 07/18/16 at 11:07am, Mark Rutland wrote: > > > On Mon, Jul 18, 2016 at 10:30:24AM +0800, Dave Young wrote: > > > > I do not think it is worth to add another syscall for extra fds. > > > > We have open(2) as an example for different numbers of arguments > > > > already. > > > > > > Did we change the syscall interface for that? > > > > > > I was under the impression that there was always one underlying syscall, > > > and the C library did the right thing to pass the expected information > > > to the underlying syscall. > > > > I'm not sure kexec_load and kexec_file_load were included in glibc, we use > > syscall directly in kexec-tools. > > > > kexec_load man pages says there are no wrappers for both kexec_load and > > kexec_file_load in glibc. > > For the above, I was talking about how open() was handled. > > If there are no userspace wrappers, then the two cases aren't comparable > in the first place... > > > > That's rather different to changing the underlying syscall. > > > > > > Regardless of how this is wrapped in userspace, I do not think modifying > > > the existing prototype is a good idea, and I think this kind of > > > extension needs to be a new syscall. > > > > Hmm, as I replied to Vivek, there is one case about the flags, previously > > the new flag will be regarded as invalid, but not we extend it it will be > > valid, this maybe the only potential bad case. > > It's true that adding suport for new flags will change the behaviour of > what used to be error cases. We generally expect real users to not be > making pointless calls for which they rely on an error being returned in > all cases. > > Regardless, this extended syscall changes some underlying assumptions > made with the development of kexec_file_load, and I think treating this > as an extension is not a great idea. From a user's perspective there is > little difference between passing an additional flag or using a > different syscall number, so I don't think that we gain much by altering > the existing prototype relative to allocating a new syscall number. If we are providing/opening up additional flags, I can't think what will it break. Same flag was invalid in old kernel but new kernel supports it and will accept it. So it sounds reasonable to me to add new flags. If existing users are not broken, then I think it might be a good idea to extend existing syscall. Otherwise userspace will have to be modified to understand a 3rd syscall also and an additional option will show up which asks users to specify which syscall to use. So extending existing syscall might keep it little simple for users. This is only if conclusion in the end is that DT needs to be passed in from user space. BTW, does kexec_load() needs to be modified too to handle DT? Vivek