From: Evgeniy Baskov <baskov@ispras.ru>
To: Borislav Petkov <bp@alien8.de>
Cc: Evgeniy Baskov <baskov@ispras.ru>,
Dave Hansen <dave.hansen@linux.intel.com>,
Ingo Molnar <mingo@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
linux-kernel@vger.kernel.org, x86@kernel.org,
Alexey Khoroshilov <khoroshilov@ispras.ru>
Subject: [PATCH v6 0/5] Parse CONFIG_CMDLINE in compressed kernel
Date: Sat, 27 Aug 2022 05:08:05 +0300 [thread overview]
Message-ID: <cover.1661565218.git.baskov@ispras.ru> (raw)
CONFIG_CMDLINE_BOOL and CONFIG_CMDLINE_OVERRIDE were ignored during
options lookup in compressed kernel, including earlyprintk option,
so it was impossible to get earlyprintk messages from that stage
of boot process via command line provided at compile time.
Being able to enable earlyprintk via compile-time option might
be desirable for booting on systems with broken UEFI command line
arguments via EFISTUB.
Changes in v2:
* Compute resulting cmdline string once if needed and then reuse it.
Store concatenation result in a static buffer.
* Add strlcat() to compressed kernel to simplify the code.
Changes in v3:
v2 had a bug: cmd_line_ptr was set to a pointer to a buffer inside
a kernel before kernel relocation, that makes this pointer invalid.
* Replace the pointer by a boolean variable to avoid storing a pointer,
since it becomes invalid during kernel relocation.
Changes in v4:
* Use better wording for commit messages.
* Add buffer overflow check to strlcat().
* Factor out common logic of cmdline resolving into helper function.
Changes in v5:
* Use strscpy() instead of strlcpy().
Changes in v6:
* Remove superfluous new line.
* Rename resolve_cmdline() to cmdline_prepare().
* Move shared/setup-cmdline.h to shared/cmdline.h
Evgeniy Baskov (5):
x86/boot: Add strlcat() and strscpy() to compressed kernel
x86: Add cmdline_prepare() helper
x86/setup: Use cmdline_prepare() in setup.c
x86/boot: Use cmdline_prapare() in compressed kernel
x86/boot: Remove no longer needed includes
arch/x86/boot/compressed/cmdline.c | 24 +++++++++++-
arch/x86/boot/compressed/ident_map_64.c | 4 --
arch/x86/boot/compressed/kaslr.c | 4 --
arch/x86/boot/compressed/misc.h | 1 +
arch/x86/boot/compressed/string.c | 50 +++++++++++++++++++++++++
arch/x86/include/asm/shared/cmdline.h | 37 ++++++++++++++++++
arch/x86/kernel/setup.c | 22 ++---------
arch/x86/purgatory/purgatory.c | 1 +
8 files changed, 115 insertions(+), 28 deletions(-)
create mode 100644 arch/x86/include/asm/shared/cmdline.h
--
2.37.2
next reply other threads:[~2022-08-27 2:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-27 2:08 Evgeniy Baskov [this message]
2022-08-27 2:08 ` [PATCH v6 1/5] x86/boot: Add strlcat() and strscpy() to compressed kernel Evgeniy Baskov
2022-08-27 2:08 ` [PATCH v6 2/5] x86: Add cmdline_prepare() helper Evgeniy Baskov
2022-09-30 17:30 ` Borislav Petkov
2022-10-04 12:33 ` Evgeniy Baskov
2022-08-27 2:08 ` [PATCH v6 3/5] x86/setup: Use cmdline_prepare() in setup.c Evgeniy Baskov
2022-08-27 2:08 ` [PATCH v6 4/5] x86/boot: Use cmdline_prapare() in compressed kernel Evgeniy Baskov
2022-08-27 2:08 ` [PATCH v6 5/5] x86/boot: Remove no longer needed includes Evgeniy Baskov
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=cover.1661565218.git.baskov@ispras.ru \
--to=baskov@ispras.ru \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=khoroshilov@ispras.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/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