All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pasha Tatashin <pasha.tatashin@soleen.com>
To: pasha.tatashin@soleen.com, sashal@kernel.org,
	ebiederm@xmission.com, rburanyi@google.com, gthelen@google.com,
	viro@zeniv.linux.org.uk, kexec@lists.infradead.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 0/2] Allow to kexec with initramfs larger than 2G
Date: Fri, 27 May 2022 02:55:33 +0000	[thread overview]
Message-ID: <20220527025535.3953665-1-pasha.tatashin@soleen.com> (raw)

Currently, the largest initramfs that is supported by kexec_file_load()
syscall is 2G.

This is because kernel_read_file() returns int, and is limited to
INT_MAX or 2G.

On the other hand, there are kexec based boot loaders (i.e. u-root),
that may need to boot netboot images that might be larger than 2G.

The first patch changes the return type from int to ssize_t in
kernel_read_file* functions.

The second patch increases the maximum initramfs file size to 4G.

Tested: verified that can kexec_file_load() works with 4G initramfs
on x86_64.

Pasha Tatashin (2):
  fs/kernel_read_file: Allow to read files up-to ssize_t
  kexec_file: Increase maximum file size to 4G

 fs/kernel_read_file.c            | 38 ++++++++++++++++----------------
 include/linux/kernel_read_file.h | 32 +++++++++++++--------------
 include/linux/limits.h           |  1 +
 kernel/kexec_file.c              | 10 ++++++---
 4 files changed, 43 insertions(+), 38 deletions(-)

-- 
2.36.1.124.g0e6072fb45-goog


WARNING: multiple messages have this Message-ID (diff)
From: Pasha Tatashin <pasha.tatashin@soleen.com>
To: kexec@lists.infradead.org
Subject: [PATCH v2 0/2] Allow to kexec with initramfs larger than 2G
Date: Fri, 27 May 2022 02:55:33 +0000	[thread overview]
Message-ID: <20220527025535.3953665-1-pasha.tatashin@soleen.com> (raw)

Currently, the largest initramfs that is supported by kexec_file_load()
syscall is 2G.

This is because kernel_read_file() returns int, and is limited to
INT_MAX or 2G.

On the other hand, there are kexec based boot loaders (i.e. u-root),
that may need to boot netboot images that might be larger than 2G.

The first patch changes the return type from int to ssize_t in
kernel_read_file* functions.

The second patch increases the maximum initramfs file size to 4G.

Tested: verified that can kexec_file_load() works with 4G initramfs
on x86_64.

Pasha Tatashin (2):
  fs/kernel_read_file: Allow to read files up-to ssize_t
  kexec_file: Increase maximum file size to 4G

 fs/kernel_read_file.c            | 38 ++++++++++++++++----------------
 include/linux/kernel_read_file.h | 32 +++++++++++++--------------
 include/linux/limits.h           |  1 +
 kernel/kexec_file.c              | 10 ++++++---
 4 files changed, 43 insertions(+), 38 deletions(-)

-- 
2.36.1.124.g0e6072fb45-goog



             reply	other threads:[~2022-05-27  2:55 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-27  2:55 Pasha Tatashin [this message]
2022-05-27  2:55 ` [PATCH v2 0/2] Allow to kexec with initramfs larger than 2G Pasha Tatashin
2022-05-27  2:55 ` [PATCH v2 1/2] fs/kernel_read_file: Allow to read files up-to ssize_t Pasha Tatashin
2022-05-27  2:55   ` Pasha Tatashin
2022-06-06  2:45   ` Baoquan He
2022-06-06  2:45     ` Baoquan He
2022-06-07 15:52     ` Pasha Tatashin
2022-06-07 15:52       ` Pasha Tatashin
2022-06-08  0:57       ` Baoquan He
2022-06-08  0:57         ` Baoquan He
2022-06-08  0:58   ` Baoquan He
2022-06-08  0:58     ` Baoquan He
2022-05-27  2:55 ` [PATCH v2 2/2] kexec_file: Increase maximum file size to 4G Pasha Tatashin
2022-05-27  2:55   ` Pasha Tatashin
2022-06-06  2:56   ` Baoquan He
2022-06-06  2:56     ` Baoquan He
2022-06-07 16:02     ` Pasha Tatashin
2022-06-07 16:02       ` Pasha Tatashin
2022-06-08  0:28       ` Baoquan He
2022-06-08  0:28         ` Baoquan He

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=20220527025535.3953665-1-pasha.tatashin@soleen.com \
    --to=pasha.tatashin@soleen.com \
    --cc=ebiederm@xmission.com \
    --cc=gthelen@google.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rburanyi@google.com \
    --cc=sashal@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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.