All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
To: AKASHI Takahiro <takahiro.akashi@linaro.org>
Cc: kexec@lists.infradead.org, ebiederm@xmission.com,
	dyoung@redhat.com, bhe@redhat.com, vgoyal@redhat.com,
	will.deacon@arm.com, catalin.marinas@arm.com,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [RFC] arm64: kexec_file_load support
Date: Mon, 04 Jul 2016 19:50:19 -0300	[thread overview]
Message-ID: <5766907.oiVi8ABPsz@hactar> (raw)
In-Reply-To: <20160704065814.GO20774@linaro.org>

Hello,

Am Montag, 04 Juli 2016, 15:58:15 schrieb AKASHI Takahiro:
> On Fri, Jul 01, 2016 at 12:46:31PM -0300, Thiago Jung Bauermann wrote:
> > I agree that it would be better if we could have a system call where a
> 
> > custom device tree could be passed. One suggestion is:
> For powerpc, you might be able to use dtbImage instead of Image
> without changing the kernel interfaces.

That works for custom kernels, but for signed kernels from a distro, I 
believe that's not an option.

> > kexec_file_load2(int fds[], int fd_types[], int nr_fds,
> > 
> > 		 unsigned long cmdline_len, const char *cmdline_ptr,
> > 		
> > 		unsigned long flags);
> 
> You don't want to simply add one more argument, i.e. dtb_fd, don't you.

I'm just trying to avoid having to add another argument later if we find out 
someone is loading another segment that we didn't know about. :-)

The older kexec_load system call allows passing an arbitrary number of 
segments (sort of, currently capped at 16) to the kernel, so my suggestions 
preserve that feature.

If people think that adding another argument for dtb_fd is enough, I won't 
mind.

> I prefer a slightly-simpler interface:
>         struct kexec_file_fd {
>                 enum kexec_file_type;
>                 int fd;
>         }
> 
>         int kexec_file_load2(struct kexec_file_fd[], int nr_fds, int
> flags);

I like this one.

> Or if you want to keep the compatibility with the existing system call,
> 
>         int kexec_file_load(int kernel_fd, int initrd_fd,
>                         unsigned long cmdline_len, const char
> *cmdline_ptr, unsigned long flags,
>                         int struct kexec_file_fd[], int nr_fds);
> 
> Here SYSCALL_DEFINE7() have to be defined, and I'm not sure that we will
> not have a problem in adding a system call with more than 6 arguments.

That's very clever. We can do what you suggest above or even just add dtb_fd 
with SYSCALL_DEFINE6. Either option would be good.

> > Where fds is an array with nr_fds file descriptors and fd_types is an
> > array specifying what each fd in fds is. So for example, if fds[i] is
> > the kernel, then fd_types[i] would have the value KEXEC_FILE_KERNEL_FD.
> > If fds[i] is the device tree blob, fd_types[i], would have the value
> > KEXEC_FILE_DTB and so on. That way, the syscall can be extended for an
> > arbitrary number and types of segments that have to be loaded, just
> > like kexec_load.
> > 
> > Another option is to have a struct:
> > 
> > kexec_file_load2(struct kexec_file_params *params, unsigned long
> > params_sz);
> Wow, we can add any number of new parameters with this interface.

Yeah, maybe it's a bit too much.

-- 
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center

WARNING: multiple messages have this Message-ID (diff)
From: bauerman@linux.vnet.ibm.com (Thiago Jung Bauermann)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC] arm64: kexec_file_load support
Date: Mon, 04 Jul 2016 19:50:19 -0300	[thread overview]
Message-ID: <5766907.oiVi8ABPsz@hactar> (raw)
In-Reply-To: <20160704065814.GO20774@linaro.org>

Hello,

Am Montag, 04 Juli 2016, 15:58:15 schrieb AKASHI Takahiro:
> On Fri, Jul 01, 2016 at 12:46:31PM -0300, Thiago Jung Bauermann wrote:
> > I agree that it would be better if we could have a system call where a
> 
> > custom device tree could be passed. One suggestion is:
> For powerpc, you might be able to use dtbImage instead of Image
> without changing the kernel interfaces.

That works for custom kernels, but for signed kernels from a distro, I 
believe that's not an option.

> > kexec_file_load2(int fds[], int fd_types[], int nr_fds,
> > 
> > 		 unsigned long cmdline_len, const char *cmdline_ptr,
> > 		
> > 		unsigned long flags);
> 
> You don't want to simply add one more argument, i.e. dtb_fd, don't you.

I'm just trying to avoid having to add another argument later if we find out 
someone is loading another segment that we didn't know about. :-)

The older kexec_load system call allows passing an arbitrary number of 
segments (sort of, currently capped at 16) to the kernel, so my suggestions 
preserve that feature.

If people think that adding another argument for dtb_fd is enough, I won't 
mind.

> I prefer a slightly-simpler interface:
>         struct kexec_file_fd {
>                 enum kexec_file_type;
>                 int fd;
>         }
> 
>         int kexec_file_load2(struct kexec_file_fd[], int nr_fds, int
> flags);

I like this one.

> Or if you want to keep the compatibility with the existing system call,
> 
>         int kexec_file_load(int kernel_fd, int initrd_fd,
>                         unsigned long cmdline_len, const char
> *cmdline_ptr, unsigned long flags,
>                         int struct kexec_file_fd[], int nr_fds);
> 
> Here SYSCALL_DEFINE7() have to be defined, and I'm not sure that we will
> not have a problem in adding a system call with more than 6 arguments.

That's very clever. We can do what you suggest above or even just add dtb_fd 
with SYSCALL_DEFINE6. Either option would be good.

> > Where fds is an array with nr_fds file descriptors and fd_types is an
> > array specifying what each fd in fds is. So for example, if fds[i] is
> > the kernel, then fd_types[i] would have the value KEXEC_FILE_KERNEL_FD.
> > If fds[i] is the device tree blob, fd_types[i], would have the value
> > KEXEC_FILE_DTB and so on. That way, the syscall can be extended for an
> > arbitrary number and types of segments that have to be loaded, just
> > like kexec_load.
> > 
> > Another option is to have a struct:
> > 
> > kexec_file_load2(struct kexec_file_params *params, unsigned long
> > params_sz);
> Wow, we can add any number of new parameters with this interface.

Yeah, maybe it's a bit too much.

-- 
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center

WARNING: multiple messages have this Message-ID (diff)
From: Thiago Jung Bauermann <bauerman@linux.vnet.ibm.com>
To: AKASHI Takahiro <takahiro.akashi@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org, bhe@redhat.com,
	kexec@lists.infradead.org, linuxppc-dev@lists.ozlabs.org,
	will.deacon@arm.com, linux-kernel@vger.kernel.org,
	ebiederm@xmission.com, catalin.marinas@arm.com,
	dyoung@redhat.com, vgoyal@redhat.com
Subject: Re: [RFC] arm64: kexec_file_load support
Date: Mon, 04 Jul 2016 19:50:19 -0300	[thread overview]
Message-ID: <5766907.oiVi8ABPsz@hactar> (raw)
In-Reply-To: <20160704065814.GO20774@linaro.org>

Hello,

Am Montag, 04 Juli 2016, 15:58:15 schrieb AKASHI Takahiro:
> On Fri, Jul 01, 2016 at 12:46:31PM -0300, Thiago Jung Bauermann wrote:
> > I agree that it would be better if we could have a system call where a
> 
> > custom device tree could be passed. One suggestion is:
> For powerpc, you might be able to use dtbImage instead of Image
> without changing the kernel interfaces.

That works for custom kernels, but for signed kernels from a distro, I 
believe that's not an option.

> > kexec_file_load2(int fds[], int fd_types[], int nr_fds,
> > 
> > 		 unsigned long cmdline_len, const char *cmdline_ptr,
> > 		
> > 		unsigned long flags);
> 
> You don't want to simply add one more argument, i.e. dtb_fd, don't you.

I'm just trying to avoid having to add another argument later if we find out 
someone is loading another segment that we didn't know about. :-)

The older kexec_load system call allows passing an arbitrary number of 
segments (sort of, currently capped at 16) to the kernel, so my suggestions 
preserve that feature.

If people think that adding another argument for dtb_fd is enough, I won't 
mind.

> I prefer a slightly-simpler interface:
>         struct kexec_file_fd {
>                 enum kexec_file_type;
>                 int fd;
>         }
> 
>         int kexec_file_load2(struct kexec_file_fd[], int nr_fds, int
> flags);

I like this one.

> Or if you want to keep the compatibility with the existing system call,
> 
>         int kexec_file_load(int kernel_fd, int initrd_fd,
>                         unsigned long cmdline_len, const char
> *cmdline_ptr, unsigned long flags,
>                         int struct kexec_file_fd[], int nr_fds);
> 
> Here SYSCALL_DEFINE7() have to be defined, and I'm not sure that we will
> not have a problem in adding a system call with more than 6 arguments.

That's very clever. We can do what you suggest above or even just add dtb_fd 
with SYSCALL_DEFINE6. Either option would be good.

> > Where fds is an array with nr_fds file descriptors and fd_types is an
> > array specifying what each fd in fds is. So for example, if fds[i] is
> > the kernel, then fd_types[i] would have the value KEXEC_FILE_KERNEL_FD.
> > If fds[i] is the device tree blob, fd_types[i], would have the value
> > KEXEC_FILE_DTB and so on. That way, the syscall can be extended for an
> > arbitrary number and types of segments that have to be loaded, just
> > like kexec_load.
> > 
> > Another option is to have a struct:
> > 
> > kexec_file_load2(struct kexec_file_params *params, unsigned long
> > params_sz);
> Wow, we can add any number of new parameters with this interface.

Yeah, maybe it's a bit too much.

-- 
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center


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

  reply	other threads:[~2016-07-04 22:50 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-01  5:11 [RFC] arm64: kexec_file_load support AKASHI Takahiro
2016-07-01  5:11 ` AKASHI Takahiro
2016-07-01  5:11 ` AKASHI Takahiro
2016-07-01 15:46 ` Thiago Jung Bauermann
2016-07-01 15:46   ` Thiago Jung Bauermann
2016-07-01 15:46   ` Thiago Jung Bauermann
2016-07-04  6:58   ` AKASHI Takahiro
2016-07-04  6:58     ` AKASHI Takahiro
2016-07-04  6:58     ` AKASHI Takahiro
2016-07-04 22:50     ` Thiago Jung Bauermann [this message]
2016-07-04 22:50       ` Thiago Jung Bauermann
2016-07-04 22:50       ` Thiago Jung Bauermann
2016-07-05  8:07       ` AKASHI Takahiro
2016-07-05  8:07         ` AKASHI Takahiro
2016-07-05  8:07         ` AKASHI Takahiro
2016-07-05  1:25     ` Dave Young
2016-07-05  1:25       ` Dave Young
2016-07-05  1:25       ` Dave Young
2016-07-05  8:03       ` AKASHI Takahiro
2016-07-05  8:03         ` AKASHI Takahiro
2016-07-05  8:03         ` AKASHI Takahiro
2016-07-07  6:12         ` Dave Young
2016-07-07  6:12           ` Dave Young
2016-07-07  6:12           ` Dave Young
2016-07-08 14:48           ` Thiago Jung Bauermann
2016-07-08 14:48             ` Thiago Jung Bauermann
2016-07-08 14:48             ` Thiago Jung Bauermann
2016-07-11  3:10             ` Dave Young
2016-07-11  3:10               ` Dave Young
2016-07-11  3:10               ` Dave Young
2016-07-11  7:19             ` AKASHI Takahiro
2016-07-11  7:19               ` AKASHI Takahiro
2016-07-11  7:19               ` AKASHI Takahiro
2016-07-11  8:14               ` Dave Young
2016-07-11  8:14                 ` Dave Young
2016-07-11  8:14                 ` 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=5766907.oiVi8ABPsz@hactar \
    --to=bauerman@linux.vnet.ibm.com \
    --cc=bhe@redhat.com \
    --cc=catalin.marinas@arm.com \
    --cc=dyoung@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=takahiro.akashi@linaro.org \
    --cc=vgoyal@redhat.com \
    --cc=will.deacon@arm.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 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.